[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

Handle

How can I get the Handle of the start button according to what computer my program is run on?
0
bradsoblesky
Asked:
bradsoblesky
  • 6
  • 4
  • 3
  • +1
1 Solution
 
chensuCommented:
Sorry, I don't understand your question.
0
 
kakamnaCommented:
what do u mean by what computer my program is run on?.
0
 
bradsobleskyAuthor Commented:
The handle to the start button on my computer is 00xC4 but it is not the same for every computer. So i want to detect the handle no matter what the computer.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
kakamnaCommented:
SO If u have some method to find the handle of the start button.
Then You should also know the Class name registered or the Window Name of the Start Button These are the members of the same window class which is registered for every window(button). So you should use the
FindWindow(Window Name,Window Class) function it will return you pointer to window and handle as well
0
 
chensuCommented:
HWND hWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
0
 
xflmlowCommented:
No offence Chensu, but bradsoblesky was trying to obtain a handle
the Start button only, not the entire taskbar.
0
 
chensuCommented:
Yeah, I knew that. But it is probably what bradsoblesky wants.
0
 
bradsobleskyAuthor Commented:
Call me Brad, and how is it that i can convert that to a string or char?
0
 
chensuCommented:
Convert what to a string or char?
0
 
kakamnaCommented:
DO U WANT TO CONVERT HANDLE TO CHAR OR STRING?. WOULD YOU PLEASE BE SPECIFIC.
0
 
bradsobleskyAuthor Commented:
I don't know what the heck i'm talking about, i wan't to be able to conver the 00xC4 of my 'start menu' to a CString. I'm not sure whether that is the handle or the window or the class or what it is but i want to get that and then convert it to a CString.
0
 
chensuCommented:
Do you mean you want a CString which is "0xC4"?

HWND hWnd = 0xC4;
CString str;
str.Format(_T("0x%X"), (DWORD)hWnd);
0
 
bradsobleskyAuthor Commented:
Lock it up chensu, and thanks for the help. You're the man!!
0
 
chensuCommented:
Thank you.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now