sendmessage

How to refresh Internet Explorer using SendMessage?

Hi, does anybody know how to refresh the Internet Explorer (like by pressingthe F5 key) but using some "backdoor" like PostMessage or SendMessage? The internet Explorer Window is not active so I can't use the keyboard. Thanks (Language doesnt matter) ...

using FindWindow with multiple root windows

So I'm building an app that uses win32's SendMessage as IPC. I'm using FindWindow to get the hWnd based on className and windowName. This has all being going fine and dandy until I want to talk to a root (as in child of the desktop) Window that has the same name / class name as other root Windows. Is there an alternative to FindWindow ...

How to align RichEdit paste object position in Visual Basic 6?

We have a RichEdit control into which we allow the user to insert an Office MathML equation object. Basically the logic goes like this: the user click on insert math equation, we allow them to use an external MathML editor, then we will paste an image to represent the equation into the RichEdit control: ' Paste the picture into the Ric...

Windows Mobile WAP Wakeup

could anyone please give me directions, or better - a working sample, of using the "WAP Wakeup" feature in Windows Mobile? I'm trying to follow directions from http://msdn.microsoft.com/en-us/library/aa919167.aspx . Unfortunately, they only give the beginning of the solution. Step 1: register your application to listen to SMS messages ...

progmatically start moving a form

I am trying to make a form move (using the titlebar) from a button click. I thought this would be simple using SendMessage: Const WM_LBUTTONDOWN As Integer = &H201 Button1.Capture = False Cursor.Position = Me.Location + New Size(50, 8) SendMessage(Me.Handle, WM_LBUTTONDOWN, CType(1, IntPtr), IntPtr.Zero) However, although this send...

Thread communication using SendMessage

Hi, my question is : how can I use SendMessage() to implement thread communication between two threads, one with a window (GUI) and the other with no window? The problem is that SendMessage() needs a handle (HWND)? Another detail about my project : Two threads, one running managed code (the one with the user interface), and the other r...

Retrieve text from a scintilla control using SendMessage

I'm attempting to retrieve the document text in Notepad++ using SendMessage in C#. Below is my current code. The first call to SendMessage correctly returns the length of the text. The second call to SendMessage does not insert the text into the StringBuilder variable text. Why not? [DllImport("user32.dll", EntryPoint = "SendMessage", ...

Are there special considerations for a windows service to send messages to user windows?

I have to write a Windows Service application (no GUI) that will monitor an event, and if it occurs will send a standard windows message to an application. The handle of the application will be given to the service by a DLL which is then unloaded, so a windows message is the way we wish to use. The question though is whether the service...

Send C++ string to C# string. Interop.

I am new to inter process communication and need some help. I want to be able to send a string from a C++ program to a C# program. My problem is that the resultant string is gibberish. Here is my code: Sending program (C++): void transmitState(char* myStr) { HWND hWnd = ::FindWindow(NULL, _T("myApp v.1.0")); if (hWnd) {...

SendMessage to click on Non-Client items.

I am having trouble getting SendMessage to activate a menu on another program. When looking through Spy++ when a user clicks on the menu the following occurs: 000A0628 P WM_NCLBUTTONDOWN nHittest:HTMENU xPos:1706 yPos:395 [wParam:00000005 lParam:018B06AA time:27:23:56.156 point:(1706, 395)] 000A0628 S WM_SYSCOMMAND uCmdType:SC_MOUSE...

Simulate Mouse move/click/keyPress in an application that is not active

Hello guys, I know how to simulate mouse and keyboard events, but they act as if the user did them, so they will affect the window that is active. What I need is to simulate one of those inputs, but in a Window that is not active. I'm not saying that it is minimized, imagine for example, you have msPaint, and notepad. Notepad is in fr...

I can't understand how to use SendMessage or PostMessage calls :(

Hi guys, I need to simulate a keypress in a third party application. Let's say I have a C# application that needs to send an "8" to the Calculator application. I can't use the SendKeys of .Net or the keybd_event of win32 api because they both require the window to be the top active one, which is not case in my situation. So that leaves...

How to programmatically choose a context menu item in another app?

The target app is written in Delphi (win32 not .NET) and is closed-source. The action I want to invoke is called Copy, but there is no obvious keyboard shortcut. (Ctrl+Insert does the wrong thing and Ctrl+C does nothing) I can find my target HWND and persuade it to open the context menu (it responds to WM_RBUTTONDOWN/UP not WM_CONTEXTM...

How to Get the Active ChildWindow of an application?

Hi guys, I have this problem. I have an handler to the mainWindow of a certain application, and I want to simulate a keypress on that application... I'm using sendMessage/postMessage api calls to do this. The reason why I don't use the .Net SendKeys function or the keybd_event of the win32 api, is that they simulate the keypress at a gl...

.NET webbrowser control automation

I'm trying to automate some stuff on a flash game running in a webbrowser control in my C# program. Using user32's sendmessage dll I've been able to click at coordinates on regular pages such as google but it doesn't work on flash content. Any ways I can do this? Also it cannot be detectable to the flash game. I have a working one in au...

SendMessage from DLL to a window in another process in Vista

I am pulling my hair out on this one. I am trying to send a message to a window in another process. I keep getting Access Denied (0x5) from GetLastError() after calling SendMessage or PostMessage or PostThreadMessage. I have tried turning off UAC. I have also accounted for UIPI by ensuring that the Integrity Levels match accross proc...

Sending string data between threads (Win32)

Hi all, This is a fairly straightforward question, I'm basically looking for a 'best practice' approach to what I'm trying to do. I have a Win32 GUI application which starts up a worker thread to do a bunch of blocking calls. I want this thread to send string messages back to the GUI so they can be displayed to the user. Currently I'm...

Send a double click to a listview (c++, not .net!)

Hello. I want to send a double click to a listview. From what I've read on msdn it seems I gotta send a WM_NOTIFY message and something with NM_DBLCLK. But I do not understand really well hwo to implement it. I've worked with SendMessage before but MSDN is not that clear on how to fill the structs and so: WM_NOTIFY http://msdn.microsoft...

Setting another program's listview selected item

Hello I want to be able to select which item is selected in another program's list view(I don't have access to its code). Actually, it is an SysListView32, which I assume is the same. I already have the following code, which unfortunely despite compiling, seems to do nothing (although SendMessage() returns 1). process=OpenProcess(PROCE...

SendMessage from VB6 app to Excel dialog box

My employer has purchased a third-party tool, OfficeConverter from Conveter Technology that automates the conversion / repair of Office 2003-formatted files to Office 2007 format. This tool also highly automates the translation / change in macro / VBA code requirements between Office 2003 and 2007 formats. My problem is that during thi...