|
RedDragon2k wrote: without installing any software on the target machine
Obviously something must run to capture the input on the target machine and inject it into the OS. So presumably you just mean that you don't want to install it first.
Should be possible to get the USB itself to do it. You might start by looking into how one boots an OS from a memory stick. Such articles have detailed info on how USB works.
|
|
|
|
|
There is no standard for connecting PCs together with a USB cable that I know of, however if you write the driver for the computer sending the commands, you could make it appear as a keyboard to the other computer so you wont need anything on the remote computer.
I'm not too familiar with USB drivers, but if you get the Windows DDK[^] and take a look there are some sample USB drivers in the src folder.
|
|
|
|
|
Your program should send out signal through the USB port you are using to connect to the target machine exactly the same signal a keyboard would send (when you use a USB keyboard). The target computer will simply believe that a USB keyboard is being plugged to the USB port. That means it's possible to achieve what you want to do. You need to work on the details, though. I believe you need to use Windows DDK to write programs to deal with USB.
|
|
|
|
|
Alright, I have clicked through the DDK, but from what I understand it doesn't seem possible to accomplish. Apparently a PC can only act as a host control, and will identify itself as such to the other computer. Any ideas for starting points?
|
|
|
|
|
Hello Friends
When a window is minimised, it goes to taskbar at the location where the tray icon is there.
So if icon is towards right, the window is minimised to the right.
I remember there was a function with some name like setwindowanimation, but seems i am missing something.
anybody has got an idea of how to do that?
Regards
|
|
|
|
|
SoftwareDeveloperGoa wrote: When a window is minimised, it goes to taskbar at the location where the tray icon is there.
Not the "tray icon": the corresponding taskbar button.
Tray icons are other things.
SoftwareDeveloperGoa wrote: So if icon is towards right, the window is minimised to the right.
Yes, but ... what are you trying to achieve? Are you trying to change the task button relative positions?
The question is not clear.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
yes you are correct, it is taskbar
yeah i want a window to minimize to a specific location, irrespective of where it's taskbar icon is present.
it is all about that animation thing that windows displays for every window relative to taskbar icon's position
|
|
|
|
|
AnimateWindow is documented here[^].
But the animation the system uses to manage the top windows depends on the system settings and theme, not on the code of your app.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
|
Hi all,
i have an list ctrl with some items,i want to perform an action with each item of list ctrl than after performing action delete this item.
i m using this.
int count =m_List.GetItemCount();
for (int i=0;i<count;i++)
{
m_List.DeleteItem(i);
}
here items are not fetched according to its serial like if firstly i m use item 1,than next item here is item 3 than 5 and so on..
here all items are not processes by this loop
please tell me what can i do for this.
thanks in advance.
|
|
|
|
|
When you delete item 0, every other item moves up 1, so what was item 1 is now item 0.
Instead of using m_List.DeleteItem(i); , use m_List.DeleteItem(0);
The same goes for getting the data or string from each of the items, you are always using the first item in the list
|
|
|
|
|
int count =m_List.GetItemCount();
for (int i=0;i<count;i++)
{
//do msometing with item i
m_List.DeleteItem(0);
}
just like this。。
|
|
|
|
|
jixuduxing wrote: //do msometing with item i
Probably just a copy/paste mistake, but
int count =m_List.GetItemCount();
for (int i=0;i<count;i++) {
m_List.DeleteItem(0);
}
|
|
|
|
|
Or even easier to understand:
int count =m_List.GetItemCount();
for (int i=0;i<count;i++)
{
}
m_List.DeleteAllItems();
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
You should start using the MSDN documentation to learn about the classes you are implementing. Had you done so you would surely have found this[^].
I must get a clever new signature for 2011.
|
|
|
|
|
Note that reversing the loop
for (int i = count-1; i >= 0; i--)
{
m_List.DeleteItem(i);
}
would solve you problem.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
int count = m_List.GetItemCount();
for (int i = count - 1;i >= 0; i--)
{
m_List.DeleteItem(i);
}
if you delete item from a list, you should delete it from the last to the first.
|
|
|
|
|
Facing an uphill batte against OpenGL vs. Vista/Win7 ...
Seems we cannot use GDI to BitBlt to do a screenshot when Aero is turned on.
Reading a lot on the web (opengl.org,gamedev.net, ...) about this, it looks like I need to use glReadPixels to get the RGB(A) values from the OpenGL buffer.
The issue is that I'm not certain how to transfer the resulting pixel array ( RGB(A) ) to something that Windows can use.
glPushAttrib(GL_PIXEL_MODE_BIT);
glReadBuffer(GL_FRONT);
glFlush();
glFinish();
unsigned char *glBuffer = new unsigned char [width*height*4];
ASSERT( glBuffer) ;
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, glBuffer);
unsigned char* Buffer = new unsigned char [width*height*3];
unsigned char* ptmp = Buffer;
unsigned char* pbuffer = glBuffer;
for (int j=0; j<height; j++)
{
for (int i=0;i<width; i++)
{
*ptmp++ = *pbuffer++;
*ptmp++ = *pbuffer++;
*ptmp++ = *pbuffer++;
pbuffer++;
}
}
delete [] glBuffer;
HBITMAP hBitmap= ::CreateBitmap(width, height, 3, 24, Buffer);
ASSERT( hBitmap);
The array returns by glReadPixels looks ok, but creating the bitmap returns a NULL handle; at first, even if it did not work, I half expected to have a corrupted bitmap, but not just a NULL.
I'm certainly missing a lot of things, but I'm not certain what; probably mixing up context and some things ... all that I can find is that people say use glReadPixels and it works!
Any idea ?
Thanks.
Max.
Watched code never compiles.
|
|
|
|
|
I think the number of planes is supposed to be 1.
HBITMAP hBitmap= ::CreateBitmap(width, height, 1, 24, Buffer);
ASSERT( hBitmap);
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Hi,
I am taking string ("Tom & Harry") from resource. In some system it is displaying like "Tom _ Harry" and some system it is fine "Tim & Harry"?
What is the problem? Please guide....
|
|
|
|
|
It sounds like the problem is where you're displaying it. If you using it in menus the & character is used the include an accelerator key. If this is the case use two &s.
Steve
|
|
|
|
|
If I remember correcly, the "&" will mark the following letter as the mnemonic (the underlined letter in the menu).
Resources strings for UI need to have "&&" : "Tom && Jerry'
(look at the documentation).
Watched code never compiles.
|
|
|
|
|
I’m trying to use ImageMagick for what I believed would be a simple task.
I want to generate a dimmed version of an image/icon at runtime in the application.
I use the magick++ c plus api.
I have found some commands that give me an ok result when run from the command line.
Converting the commands to the c++ api was a bit challenging, and the result is then not as hoped.
// Command example
convert -size 32x32 xc:"#999999" gray32.png
composite -dissolve 50% logo32.png gray32.png dim_logo32.png
How would this look in c++?
I came up with this.
Magick::Image gray;
gray.size( Magick::Geometry(image.columns(), image.rows()));
gray.read( "xc:#999999");
gray.label( "gray" );
if(gray.isValid()) {
gray.opacity(QuantumRange/2);
image.composite(gray, Magick::Geometry(image.columns(),image.rows()), Magick::DissolveCompositeOp );
But the transparency in the picture is lost.
A other suggestion as to make a dimmed image, is to make the full image semi transparent.
convert input.png -channel Alpha -evaluate Set 50% output.png
This could work. The transparency is kept when I tried this from command line.
Changing this to c++ api confused me a lot.
I ended up with this single line.
image.opacity(QuantumRange/ 2);
Now the result from this confuses me. The image is semi transparent, but the background that was originally transparent is now magenta.
orginal icon
dimmed icon
|
|
|
|
|
Thue Andersen wrote: Now the result from this confuses me. The image is semi transparent, but the background that was originally transparent is now magenta.
i suspect you've set the entire alpha channel to 128, not just reduced the exiting alpha by 1/2.
|
|
|
|
|
Aside from the transperency in the alpha channel, one pixel value can be chosen as fully transparent. This is often chosen to be magenta (R=255, G=0, B=255, A=255).
Now that you have modified the alpha component of every pixel, what was previously (R=255, G=0, B=255, A=255), is now (R=255, G=0, B=255, A=128). It's no longer recognised as fully transparent and instead treated as magenta at half transperency.
So to solve your problem, you'd have to either exclude the magenta (R=255, G=0, B=255, A=255) pixels from having their transperency halved or change the transparent pixel value to be (R=255, G=0, B=255, A=128).
modified on Friday, January 14, 2011 6:04 PM
modified 13-Sep-18 21:01pm.
|
|
|
|