|
You could use a borderless popup window. You could even use window regions to have the window in the shape you want.
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for your answer.if it's possible for you please more explain.
imagin you want to draw a line on Specified window.recently i used this codes to draw a line on my application's dialog:
CClientDc mydc(this);
mydc.MoveTo(5, 20);
mydc.LineTo(80,20);
but this codes draw a line in my application's dialog. Who can i draw a line in every window that i want?
|
|
|
|
|
You really can't do that in MFC or at least not using any MFC commands because the windows you are trying to draw on don't belong to MFC
You can use WIN32 API commands to draw on the desktop like this
HDC hDC_Desktop = GetDC(0);
RECT rect = { 0, 0, 200, 200 };
HBRUSH blueBrush=CreateSolidBrush(RGB(0,0,255));
FillRect(hDC_Desktop, &rect, blueBrush);
Your drawing wont stay there very long or be refreshed however
To make anything permanent on the desktop you need to subclass the desktop handler and it's paint message and that requires a lot more knowledge.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773183%28v=vs.85%29.aspx[^]
I suspect you are going to tell us more about what you are trying to do.
|
|
|
|
|
How to send a keystroke or a mouse event to another running process in Ubuntu? I want to write a C program that reads data from the USB port sent by AVR Micro Controller board continuously.In response to that it checks the data received and sends a command to another process running on the computer? Example,when the program reads 101 from the USB port it sends left mouse button down to the VLC media player window that is currently running? Can anybody explain the whole process in detail?? I would be very thankful...
|
|
|
|
|
What's wrong in Google[^]?
Veni, vidi, vici.
|
|
|
|
|
I have no idea on the mouse manipulation stuff, but you can read stuff from the AVR board if it is visible as COM Port .
Where is your problem exactly?
Do you have a problem reading the data from the AVR board, or getting the mouse to move?
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
How to ask a question
|
|
|
|
|
hello every body
i try to develop a client and a server project by visual studio 2010!
now i have alot of question
1- how can i test the connection between client and server???
2- how my server could have a list of connected clients???
please help me i am a beginner!!!
|
|
|
|
|
To test your programs start them both on your machine and use the loopback device (IP: 127.0.0.1, name: localhost) for listening and connection.
If a server accepts and handles multiple connections at the same time the state of each connection is typically stored in some manner. This must be implemented by you and the information to be stored depends on your requirements. If you need a list of clients, one piece of information to be stored is the client IP.
I suggest to start with a server that accepts only one client at time. Then you can test the communication and implement multiple client support when the other things are working.
|
|
|
|
|
In addition to what Jochen has mentioned, I would look at WireShark which is a tool to view network communications. I have found it invaluble for debugging network type applications, though I think client and server have to be on different machines (I could be wrong on that one) for Wireshark to record the data.
|
|
|
|
|
Wireshark is a must have for network programming
...I do remember some issue with seeing the loopback data, but I can't remember it 100%... think you get spoiled having a bunch of computers sitting on your desk at all times.
|
|
|
|
|
Myself I doubt a beginner with no experience in sockets is going to get much use out of wireshark.
|
|
|
|
|
I don't know, I started using it almost immediately, while debugging my first network type application.
|
|
|
|
|
Member 10757148 wrote: 1- how can i test the connection between client and server???
Write TWO applications.
One does only client.
One does only server.
For testing you can there run each individually in TWO instances of VS 2010. (You can run from the command line as well but you will probably want to use the debugger in VS.)
Member 10757148 wrote: 2- how my server could have a list of connected clients???
You should try reading up a bit on sockets. Much of it won't make sense but it will give you some more basics on 'how' a server handles multiple clients.
That said I would STRONGLY suggest that you first start with only a single client.
|
|
|
|
|
I downloaded a project from codeproject that makes multiple selection posibible on a CTreeCtrl. The link is: [^]
The downloaded project works fine, I mean it works to select multiple lines with the Ctrl key.
I created a project on my own, taking from the downloaded project just CCustomTreeCtrl files, because I need just CCustomTreeCtrl. So, my problem is that it does not work to select multiple lines in the tree control in my project, but in the downloaded project it does. How can this be? I cannot figure it out. I checked and double checked to see if there's any notable difference, and I can't see any.
|
|
|
|
|
At first glance, that article seems to be more geared towards rubber banding a selection. While Ctrl+Click may work, too, there may be extra code there that is messing you up. Perhaps you could use Paul DiLascia'c code from here, or a related article (alas with more features) from here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Thanks for your reply and for the provided links.
|
|
|
|
|
I tried the code from the second link. It behaves the same as the code from Syed Babu from codeproject. If I select multiple items using Ctrl and left mouse button it selects JUST THE LAST 2 previously selected items; the first item selected in a row of three is always deselected. I don't get it, I have the same code as the original code. There's something strange here.
|
|
|
|
|
The code looks fine actually. Can you elaborate the problem you are facing in this code?
mohsinmunawar [at] gmail [dot] com
|
|
|
|
|
|
I cannot attach the two projects here. I don't see any attach button. Can I send you on a private mail the two projects and have a quick look, please?
|
|
|
|
|
Sure that will be great. My email address is:
mohsinmunawar [at] gmail [dot] com
|
|
|
|
|
Dear all:
I implement a application, when I log in windows, the application will auto
start, and write registry in HKEY_CURRENT_USER,
SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run.
The context of registry is a wav file path.
I put the wav file and the application in the same folder.
My code show as below:
HKEY hKey = HKEY_CURRENT_USER;
TCHAR filePath[MAX_PATH];
TCHAR dirPath[MAX_PATH];
GetCurrentDirectory(MAX_PATH, dirPath);
StringTruncate(filePath, dirPath, "\\Default.wav");
WriteReg(hKey, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion"), _T("Sound"), filePath);
My question is:
when I log in windows, the registry value always equal to C:\Windows\system32\Default.wav, Not my folder path.
How can I write the right wav file path after windows log in?
Thanks for your help, Victor.
|
|
|
|
|
Did you check that writing to the registry was successful?
|
|
|
|
|
Dear Jochen:
I use the same code, but different condition.
condition 1: windows run stable, it write the registry success with my folder.
condition 2: after log in windows, it write the C:\Windows\system32 path.
Thanks for your help, Victor.
|
|
|
|
|
What is the value of filePath at the time of writing? Hint: it's not what you think it is.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|