|
Sorry my mistake, here's the GetProcessHandle void
HANDLE CmyGUIApp::GetProcessHandle(LPSTR szExeName)
{
PROCESSENTRY32 Pc = { sizeof(PROCESSENTRY32) };
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
if(Process32First(hSnapshot, Pc)){
do{
if(!strcmp(Pc.szExeFile, szExeName))
{
return OpenProcess(PROCESS_ALL_ACCESS, TRUE, Pc.th32ProcessID);
}
}while(Process32Next(hSnapshot, Pc));
}
return NULL;
}
Debugging the program on Windows 7 where on I have my VC++ installed doesn't show any error or any thing strange, I can terminate any process just by replacing "calc.exe" with another process name, the void above returns the exact process handle and the process gets terminated. Should I debug the program on Windows XP? How? I have only one license of VC++ which is currently installed on Windows 7, can I use WinDbg to debug my program on XP and how? please guide me I am new to all of this staff! Thanks
|
|
|
|
|
If you're familiar with Windbg its fine, but otherwise you could try Remote Debugging[^] in Visual Studio.
|
|
|
|
|
Hi all
Which book is good for MFC Hard disk programing book Or Online tutorial link?
|
|
|
|
|
mdocvc wrote: MFC Hard disk programing
What is MFC hard disk programming ?
Watched code never compiles.
|
|
|
|
|
Maximilien wrote: What is MFC hard disk programming ?
Not easy!
It's time for a new signature.
|
|
|
|
|
I would recommend you this excellent book for MFC if you are advanced [^] and this useful tutorial if you are beginner [^].
Life is a stage and we are all actors!
|
|
|
|
|
Very helpful link. Thanks Hristo!
|
|
|
|
|
|
|
hello guys...im newbie and wanted to learn pocketpc 2003 programing using c++ (using MS VS 2008), but could not find the appropriate book (may be could not find porper key words for query to google). I will be thankful if you suggest me one. Also, I wanted to learn MFC using MS VS 2008, a book on this topic will also be appreiated (i found books on MFC but not MFC using VS 2008).Thanks in advance.
|
|
|
|
|
Muzammil Saeed wrote: may be could not find porper key words for query to google
What could be easier than this[^]?
It's time for a new signature.
|
|
|
|
|
So long story short, I am investigating using Winsock/UDP to communicate between two software packages on separate computers hardwired together.
The issue i am having right away is, on the client&server how do you specify what port/adapter is going to be sending the packets if you have multiple?
I want to be just doing pure UDP broadcast packets(255.255.255.255) as its a point to point connection and setting up IP addresses every time would be too much of a hassle for reasons i wont go into.
|
|
|
|
|
Member 2598478 wrote: setting up IP addresses every time would be too much of a hassle for reasons i wont go into.
Well if you use the IP address of the target machine the network layer will automatically use the adapter that links the machine with that IP address.
It's time for a new signature.
|
|
|
|
|
Sending a UDP package to the universal broadcast address 255.255.255.255 should work on all network interfaces... at least on Windows. Broadcasting is only guaranteed to work within the LAN, in case you have a bigger (company) LAN the broadcast could be limited to your network segment. UDP is commonly used for service discovery in the LAN, once peers have found each other you can switch to another protocol, because UDP is not the most reliable transport available.
Give it a try!
|
|
|
|
|
Thanks for the replies.
When you say it should work on all network interfaces, when i open a socket how do i know which adapter/port it will do it on? Im assuming it wont broadcast it on all ports, or will it?
The issue comes in is this...
The testing machine would be on two networks, the corporate and then this "link" to the other machine under test(neither of which have an IP address assigned on that link).
I absolutely can not be sending broadcast packets across the corporate network, it must go over the other port im just confused looking at the inputs for the Winsock functions how you would specify which port to use if there was no IP address on either end.
|
|
|
|
|
|
Hi,
I would like to create something similar to the Windows Media Player miniplayer in the task bar. I don't expect many problems with coding the desk band (plenty of documentation about that), but I'm still wondering how to start with coding the skinned UI.
When looking into Windows Media Player's resources, I have found the following images: http://img130.imageshack.us/img130/5195/wmpbandimages.png[^]
The first image is obviously a mask, and then there are images for normal, disabled, hottracked and pressed states. I guess that I should take the different parts of the 'state' images (according to the state of each part), and merge these into a single image that shows the current UI. But how can I do this?
I would prefer not to use any libraries, just C++ and the plain Windows API.
Thanks.
|
|
|
|
|
Here[^] is a really good tutorial that should help you.
It's time for a new signature.
|
|
|
|
|
Thanks for the link, but that tutorial only shows how to create non-rectangular windows with a bitmap background. I don't need a non-rectangular window, but a normal window with non-rectangular buttons on it, by using a colored mask (the top image in http://img130.imageshack.us/img130/5195/wmpbandimages.png[^]).
|
|
|
|
|
Sorry, but your title asked for information on "skinned UI". I'm not sure how to do the buttons you are asking for, but probably something similar. Try the articles here on CodeProject, it's quite likely some other CP member has written about it.
It's time for a new signature.
|
|
|
|
|
Rather than using 3rd party gui library its hard to say its possible. If you can use some library like SkinCrafter then you can easily get what you want.
|
|
|
|
|
Please reply to the poster of the original question.
It's time for a new signature.
|
|
|
|
|
Of course it must be possible, I'm pretty sure that no library was used in the WMP desk band either. SkinCrafter looks like it's hugely overkill for my (relatively simple) problem.
|
|
|
|
|
OK, I've done some more searching, but unfortunately, I couldn't find any examples of how to use such a multi-colored mask.
However, I think that I should take the following approach: for each color in the multi-colored mask, create a 2-color mask with the current color replaced by black, and all other colors replaced by white (by using something like ReplaceColor at How to replace a color in a HBITMAP[^]). Then, those 2-color masks can be used to BitBlt the individual segments (that might come from different state images) into one single image.
Is this the right approach? I want to be sure that I haven't missed anything before starting to implementing this.
|
|
|
|
|
Tim De Baets wrote: Is this the right approach?
Sorry but I couldn't say as I've never tried it. I offered the window skinning tutorial as that was something I have done in the past.
It's time for a new signature.
|
|
|
|