bhavna_816 0 Junior Poster

How can we do this in VB.NET?
//create two structures to hold our Main Window handle
//and the Button's handle
HWND WindowHandle;
HWND ButtonHandle;
//this window's caption is "Microsoft Office Outlook", so we search for it's handle using the FindWindow API
WindowHandle = FindWindow(NULL, "Microsoft Office Outlook");
//the Button's Caption is "Yes" and it is a "Button".
ButtonHandle = FindWindowEx(WindowHandle, 0, "Button", "&Yes");
//send a message to the button that you are "clicking" it. Surprisingly C++ understands what BM_CLICK is without having to set it. Different than VB
SendMessage (ButtonHandle, BM_CLICK, 0 , 0);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.