Search Results

Search found 225 results on 9 pages for 'sendmessage'.

Page 1/9 | 1 2 3 4 5 6 7 8 9  | Next Page >

  • SendMessage videocapture consts

    - by Rita
    Hello, I am using a code sample to connect to a webcam, and don't really understand the meaning of the variables passed to the SendMessage method. SendMessage(DeviceHandle, WM_CAP_SET_SCALE, -1, 0) SendMessage(DeviceHandle, WM_CAP_SET_PREVIEW, -1, 0) What does the -1 mean? To scale/preview or not to scale/preview? I'd prefer that zero/one would be used, zero meaning false, and have no idea what the -1 means. SendMessage(DeviceHandle, WM_CAP_EDIT_COPY, 0, 0); What does the zero mean in this case? Or does this message is simply void and the zero has no meaning, similar to the last zero argument? Btw, what DOES the last zero argument mean? Thank you very much in advance :)

    Read the article

  • Use SendMessage in C# to perform a CTRL-C operation on a given handle

    - by gtaborga
    Hello everyone, I'm trying to perform a (CTRL-C) copy on a window. I've already managed to do this using SendInput but unfortunately that could fail if the window doesn't have focus. I'm trying to perform the same (CTRL-C) operation using SendMessage in C#. So far I haven't been successful in getting the WPARAM and LPARAM combination for this to work. I have also tried using SendMessage with the WM_COPY message but that didn't work for my needs. Please if anyone has done this before successfully using SendMessage I would greatly appreciate your help.

    Read the article

  • SendMessage (F4) fails when sending it to window

    - by Olli
    Working with Visual Studio 6 (VC++ 6.0) I'm using an ActiveX datepicker control which I fail to show expanded by default (3006216). Alternatively I'm trying to send a keyboard message (F4) to my window to open up the control, but nothing happens when I do so... // try 1: use the standard window handle LRESULT result = ::SendMessage(m_hWnd,VK_F4, 0, 0); // try 2: use just use the SendMessage result = SendMessage(VK_F4); result is always 0 - what can I do to test/verify the message sending? Thanks in acvance a lot... Olli

    Read the article

  • C# SendMessage to C++ WinProc

    - by jws
    I need to send a string from C# to a C++ WindowProc. There are a number of related questions on SO related to this, but none of the answers have worked for me. Here's the situation: PInvoke: [DllImport("user32", CharSet = CharSet.Auto)] public extern static int SendMessage(IntPtr hWnd, uint wMsg, IntPtr wParam, string lParam); C#: string lparam = "abc"; NativeMethods.User32.SendMessage(handle, ConnectMsg, IntPtr.Zero, lparam); C++: API LRESULT CALLBACK HookProc (int code, WPARAM wParam, LPARAM lParam) { if (code >= 0) { CWPSTRUCT* cwp = (CWPSTRUCT*)lParam; ... (LPWSTR)cwp->lParam <-- BadPtr ... } return ::CallNextHookEx(0, code, wParam, lParam); } I've tried a number of different things, Marshalling the string as LPStr, LPWStr, also tried creating an IntPtr from unmanaged memory, and writing to it with Marshal.WriteByte. The pointer is the correct memory location on the C++ side, but the data isn't there. What am I missing?

    Read the article

  • c# SendMessage and Skype woes

    - by Xcelled194
    I'm trying to create an add-on to Skype with C#. I don't want to use Skype4COM, as I'd like the experience with messages and such. Unfortunately, the messages are tripping me up. I've got the pumps and such set up. They all work, and my app successfully sends the "APIDiscover" message to Skype, gets a "PendingAuth" response and then the "AttachSuccess" message. However, when I try to send "ping" to Skype (to which it should reply "pong") nothing happens. The return code from SendMessage is 0 but Marshall.GetLastWin32Error is 1400 (Invalid handle). The handle was returned with the AttachSuccess method. The equivalent C++ code does work, so I'm at a loss. First is the C++ code I'm using as a guide: Here's the (cut down) message pump. You can ignore everything but where I put the //<---- static LRESULT APIENTRY SkypeAPITest_Windows_WindowProc( HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam) { LRESULT lReturnCode; bool fIssueDefProc; lReturnCode=0; fIssueDefProc=false; switch(uiMessage) { case WM_COPYDATA: if( hGlobal_SkypeAPIWindowHandle==(HWND)uiParam ) { PCOPYDATASTRUCT poCopyData=(PCOPYDATASTRUCT)ulParam; printf( "Message from Skype(%u): %.*s\n", poCopyData->dwData, poCopyData->cbData, poCopyData->lpData); lReturnCode=1; } break; default: if( uiMessage==uiGlobal_MsgID_SkypeControlAPIAttach ) { switch(ulParam) { case SKYPECONTROLAPI_ATTACH_SUCCESS: printf("!!! Connected; to terminate issue #disconnect\n"); hGlobal_SkypeAPIWindowHandle=(HWND)uiParam;//<---- Right here is where we receive the handle from Skype. break; } if( fIssueDefProc ) lReturnCode=DefWindowProc( hWindow, uiMessage, uiParam, ulParam); return(lReturnCode); } and this is the (again dumbed down) "sending message" code void __cdecl Global_InputProcessingThread(void *) { static char acInputRow[1024]; bool fProcessed; if( SendMessageTimeout( HWND_BROADCAST, uiGlobal_MsgID_SkypeControlAPIDiscover, (WPARAM)hInit_MainWindowHandle, 0, SMTO_ABORTIFHUNG, 1000, NULL)!=0 ) { while(Global_Console_ReadRow( acInputRow, sizeof(acInputRow)-1)) { if( fProcessed==false && hGlobal_SkypeAPIWindowHandle!=NULL ) { COPYDATASTRUCT oCopyData; // send command to skype oCopyData.dwData=0; oCopyData.lpData=acInputRow; oCopyData.cbData=strlen(acInputRow)+1; if( oCopyData.cbData!=1 ) { if( SendMessage( hGlobal_SkypeAPIWindowHandle, WM_COPYDATA, (WPARAM)hInit_MainWindowHandle, (LPARAM)&oCopyData)==FALSE ) { hGlobal_SkypeAPIWindowHandle=NULL; printf("!!! Disconnected\n"); } } } } } SendMessage( hInit_MainWindowHandle, WM_CLOSE, 0, 0); SetEvent(hGlobal_ThreadShutdownEvent); fGlobal_ThreadRunning=false; } And now here's my C# public bool PreFilterMessage(ref Message m) { Console.WriteLine(m.ToString()); if (m.Msg == WM_COPYDATA && SkypeAPIWindowHandle == m.WParam) { SkypeMessage(m); return true; } if (m.Msg == MsgApiAttach) { switch (m.LParam.ToInt32()) { case (int)SkypeControlAPIAttach.SUCCESS: SkypeAPIWindowHandle = m.WParam; //Here's where we set the Skype Handle AttachSuccess(m); return true; } } return false; //Defer all other messages } And here is my DLL import and Sending code [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMessageA(IntPtr hWnd, UInt32 Msg, IntPtr wParam, ref MsgHelper.COPYDATASTRUCT lParam); public static void Command(string c) { if (c.Last() != '\0') c += "\0"; //Make string null terminated Console.WriteLine(); MsgHelper.COPYDATASTRUCT cda = new MsgHelper.COPYDATASTRUCT(); cda.dwData = new IntPtr(0); cda.lpData = c; cda.cbData = c.Length + 1; Marshal.GetLastWin32Error(); //Clear last error Console.WriteLine(SendMessageA(mHelper.SkypeAPIWindowHandle, MsgHelper.WM_COPYDATA, IntPtr.Zero, ref cda)); Console.WriteLine(Marshal.GetLastWin32Error()); } COPYDATASTRUCT is: public struct COPYDATASTRUCT { public IntPtr dwData; public int cbData; [MarshalAs(UnmanagedType.LPStr)] public string lpData; } I think that's everything. Let me know if I forgot something. Any ideas why I'm getting the 1400?

    Read the article

  • SendMessage to window created by AllocateHWND cause deadlock

    - by user2704265
    In my Delphi project, I derive a thread class TMyThread, and follow the advice from forums to use AllocateHWnd to create a window handle. In TMyThread object, I call SendMessage to send message to the window handle. When the messages sent are in small volume, then the application works well. However, when the messages are in large volume, the application will deadlock and lose responses. I think may be the message queue is full as in LogWndProc, there are only codes to process the message, but no codes to remove the messages from the queue, that may cause all the processed messages still exist in the queue and the queue becomes full. Is that correct? The codes are attached below: var hLogWnd: HWND = 0; procedure TForm1.FormCreate(Sender: TObject); begin hLogWnd := AllocateHWnd(LogWndProc); end; procedure TForm1.FormDestroy(Sender: TObject); begin if hLogWnd <> 0 then DeallocateHWnd(hLogWnd); end; procedure TForm1.LogWndProc(var Message: TMessage); var S: PString; begin if Message.Msg = WM_UPDATEDATA then begin S := PString(msg.LParam); try List1.Items.Add(S^); finally Dispose(S); end; end else Message.Result := DefWindowProc(hLogWnd, Message.Msg, Message.WParam, Message.LParam); end; procedure TMyThread.SendLog(I: Integer); var Log: PString; begin New(Log); Log^ := 'Log: current stag is ' + IntToStr(I); SendMessage(hLogWnd, WM_UPDATEDATA, 0, LPARAM(Log)); Dispose(Log); end;

    Read the article

  • "SendMessage" to 3 different processes in C++

    - by user1201889
    I want to send keystrokes to multiple processes. For example, if I press “1”, then I want to send the “1” to 3 "Notepad windows". Frist I want to try to send a keystroke to notepad, but it fails on the HWND: //HANDLE hWin; HWND windowHandle = FindWindowA(NULL, "Notepad"); //Can’t find a proccess //Send a key if( windowHandle ) //This one fails { while(true) { if( GetAsyncKeyState(VK_F12) != 0 ) { SendMessageA(windowHandle, WM_KEYDOWN, VK_NUMPAD1, 0); Sleep(1000); SendMessageA(windowHandle, WM_KEYUP, VK_NUMPAD1, 0); } Sleep(100); } } But the "FindWindow" method is not good enough for my program. There is also no way to get 3 different processes with the same name. So how can I make 3 handles to 3 different processes with the same name? And how can I send key’s to the processes?

    Read the article

  • Can't send key to window with SendMessage

    - by user297313
    I'm writing a C program under Windows that should send an ENTER key to a dialog box to close it automatically. I retrieve the handle to the top level window I'm interested in (by means of EnumDesktopWindows()) and then try to send an ENTER key using SendMessage (note also that closing the window by sending WM_CLOSE works fine). None of the following works: SendMessage( hTargetWindow, WM_CHAR, VK_RETURN, 0 ); SendMessage( hTargetWindow, WM_CHAR, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYDOWN, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYUP, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYDOWN, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_CHAR, VK_RETURN, 1 ); SendMessage( hTargetWindow, WM_KEYUP, VK_RETURN, 1 ); and so on... As a possibly simpler scenario, I also tried to send an ascii key to, say, notepad. How is this supposed to work? Thanks in advance

    Read the article

  • How to send Ctrl/Shift/Alt + Key combinations to an application window? (via SendMessage)

    - by user1792042
    I can successfully send any single key message to an application, but don't know how to send combinations of keys (like Ctrl+F12, Shift+F1, Ctrl+R, etc..) Tired doing this that way: SendMessage(handle, WM_KEYDOWN, Keys.Control, 0); SendMessage(handle, WM_KEYDOWN, Keys.F12, 0); SendMessage(handle, WM_KEYUP, Keys.F12, 0); SendMessage(handle, WM_KEYUP, Keys.Control, 0); but this doen not seems to work.. (application act like only F12 is pressed, not Ctrl+F12).. Any ideas how to make this work?

    Read the article

  • how send data record using SendMessage(..) in separate process

    - by XBasic3000
    i use to send a data on two separate process but it fails. it works only under same process... this is concept. //----------------------------------------------------------------------------------- MainApps //----------------------------------------------------------------------------------- Type PMyrec = ^TMyrec; TMyrec = Record name : string; add : string; age : integer; end; :OnButtonSend var aData : PMyrec; begin new(aData); aData.Name := 'MyName'; aData.Add := 'My Address'; aData.Age : 18; SendMessage(FindWindow('SubApps'),WM_MyMessage,0,Integer(@aData)); end; //----------------------------------------------------------------------------------- SubApps //----------------------------------------------------------------------------------- Type PMyrec = ^TMyrec; TMyrec = Record name : string; add : string; age : integer; end; :OnCaptureMessage var aData : PMyrec; begin aData := PMyrec(Msg.LParam); showmessage(aData^.Name); end;

    Read the article

  • SendMessage vs. WndProc

    - by Poma
    I'm trying to extend TextBox control to add watermarking functionality. The example I've found on CodeProject is using imported SendMessage function. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); void SetWatermark() { SendMessage(this.Handle, 0x1501, 0, "Sample"); } I'm wondering why not use protected WndProc instead void SetWatermark() { var m =new Message() { HWnd = this.Handle, Msg = 0x1501, WParam = (IntPtr)0, LParam = Marshal.StringToHGlobalUni("Sample") }; WndProc(ref m); } Both seem to work fine. Almost all examples I've seen on internet use SendMessagefunction. Why is that? Isn't WndProc function designed to replace SendMessage? P.S. I don't know right to convert string to IntPtr and found that Marshal.StringToHGlobalUni works ok. Is it right function to do this?

    Read the article

  • Explanation of SendMessage message numbers? (C#, Winforms)

    - by John
    I've successfully used the Windows SendMessage method to help me do various things in my text editor, but each time I am just copying and pasting code suggested by others, and I don't really know what it means. There is always a cryptic message number that is a parameter. How do I know what these code numbers mean so that I can actually understand what is happening and (hopefully) be a little more self-sufficient in the future? Thanks. Recent example: using System.Runtime.InteropServices; [DllImport("user32.dll")] static extern int SendMessage(IntPtr hWnd, uint wMsg,UIntPtr wParam, IntPtr lParam); SendMessage(myRichTextBox.Handle, (uint)0x00B6, (UIntPtr)0, (IntPtr)(-1));

    Read the article

  • sendmessage mouseevent not working

    - by kevin
    I have this code: Private Const MOUSEEVENTF_LEFTDOWN = &H2 Private Const MOUSEEVENTF_LEFTUP = &H4 Dim WindowHandle As Long = FindWindow(vbNullString, "Ultima Online") SendMessage(WindowHandle, MOUSEEVENTF_LEFTDOWN, 0, 0) SendMessage(WindowHandle, MOUSEEVENTF_LEFTUP, 0, 0) I know it is getting the windowhandle fine, because I made a conditional statment that pops up a messagebox if windowhandle = 0 The problem is that it is not sending the mouse click to the window.

    Read the article

  • Chrome extension: sendMessage doesn't work

    - by user3334776
    I've already read the documentation from Google on 'message passing' a few times and have probably looked at over 10 other questions with the same problem and already tried quiet a few variations of most of their "solutions" and of what I have below... This is black magic, right? Either way, here it goes. Manifest File: { "manifest_version" : 2, "name" : "Message Test", "version" : "1.0", "browser_action": { "default_popup": "popup.html" }, "background": { "scripts": ["background.js"] }, "content_scripts": [ { "matches" : ["<all_urls>"], "js": ["message-test.js"] } ] } I'm aware extensions aren't suppose to use inline JS, but I'm leaving this in so the original question can be left as it was since I still can't get the message to send from the background page, When I switch from the popup to the background, I removed the appropriate lines from the manifest.json popup.html file: <html> <head> <script> chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {greeting: "hello", theMessage: "Why isn\'t this working?"}, function(response) { console.log(response.farewell); }); }); </script> </head> <body> </body> </html> OR background.js file: chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {greeting: "hello", theMessage: "Why isn\'t this working?"}, function(response) { console.log(response.farewell); }); }); message-test.js file: var Mymessage; chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { if (message.greeting == "hello"){ Mymessage = message.theMessage; alert(Mymessage); } else{ sendResponse({}); } }); No alert(Mymessage) goes off. I'm also trying to execute this after pressing a button from a popup and having a window at a specified url, but that's a later issue. The other files can be found here except with the background.js content wrapped in an addEventListener("click"....: http://pastebin.com/KhqxLx5y AND http://pastebin.com/JaGcp6tj

    Read the article

  • IPC using SendMessage but receiver have random window caption

    - by iira
    I found "Delphi Inter Process Communication (IPC) using SendMessage" with Google. Here's a piece of the code from Sender to send a message for Receiver : procedure TfrmClient.FormCreate(Sender: TObject); begin MyMsg := RegisterWindowMessage('MyMessage'); ServerApplicationHandle := FindWindow('TApplication', 'Project1'); end; The problem is my receiver have random caption name. So how can I send a message to receiver? Any idea? My Sender is a DLL and my receiver is Exe.

    Read the article

  • How to use SendMessage to another form in same app

    - by Robert Frank
    I've been trying to get this to work for some time now and can't figure it out. Probably obvious once you know it. I simply want a non-modal form (or perhaps an instantiated non-TForm class) to send a message to the application's main form. I can make the main form send a message to itself and receive (announcing with a beep) But, I can't seem to have other objects send messages to the main form. I'm using WM_MY_MESSAGE = WM_APP + 200; What should the first argument of the SendMessage be to send a message to the main form? Even sending it to Application.MainForm.Handle doesn't seem to work. The reason I need to do this is that the modal form has a slider that another form (#2) needs to know when it changes. Notifying the other form via a callback procedure was making it sluggish as form #2 did some work before returning from the call. Is having a modal form send a windows message to the main form a reasonable way to avoid this?

    Read the article

  • Capture Highlighted Text from any window using C#

    - by dineshrekula
    How to read the highlighted/Selected Text from any window using c#. i tried 2 approaches. Send "^c" whenever user selects some thing. But in this case my clipboard is flooded with lots of unnecessary data. Sometime it copied passwords also. so i switched my approach to 2nd method, send message method. see this sample code [DllImport("user32.dll")] static extern int GetFocus(); [DllImport("user32.dll")] static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach); [DllImport("kernel32.dll")] static extern uint GetCurrentThreadId(); [DllImport("user32.dll")] static extern uint GetWindowThreadProcessId(int hWnd, int ProcessId); [DllImport("user32.dll") ] static extern int GetForegroundWindow(); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern int SendMessage(int hWnd, int Msg, int wParam, StringBuilder lParam); // second overload of SendMessage [DllImport("user32.dll")] private static extern int SendMessage(IntPtr hWnd, uint Msg, out int wParam, out int lParam); const int WM_SETTEXT = 12; const int WM_GETTEXT = 13; private string PerformCopy() { try { //Wait 5 seconds to give us a chance to give focus to some edit window, //notepad for example System.Threading.Thread.Sleep(5000); StringBuilder builder = new StringBuilder(500); int foregroundWindowHandle = GetForegroundWindow(); uint remoteThreadId = GetWindowThreadProcessId(foregroundWindowHandle, 0); uint currentThreadId = GetCurrentThreadId(); //AttachTrheadInput is needed so we can get the handle of a focused window in another app AttachThreadInput(remoteThreadId, currentThreadId, true); //Get the handle of a focused window int focused = GetFocus(); //Now detach since we got the focused handle AttachThreadInput(remoteThreadId, currentThreadId, false); //Get the text from the active window into the stringbuilder SendMessage(focused, WM_GETTEXT, builder.Capacity, builder); return builder.ToString(); } catch (System.Exception oException) { throw oException; } } this code working fine in Notepad. But if i try to capture from another applications like Mozilla firefox, or Visual Studio IDE, it's not returning the text. Can anybody please help me, where i am doing wrong? First of all, i have chosen the right approach?

    Read the article

  • Click at specified client area

    - by VixinG
    Click doesn't work - I don't know why and can't find a solution :( ie. Click(150,215) should move mouse to the client area and click there. [DllImport("user32.dll")] private static extern bool ScreenToClient(IntPtr hWnd, ref Point lpPoint); [DllImport("user32", SetLastError = true)] private static extern int SetCursorPos(int x, int y); static void MouseMove(int x, int y) { Point p = new Point(x * -1, y * -1); ScreenToClient(hWnd, ref p); p = new Point(p.X * -1, p.Y * -1); SetCursorPos(p.X, p.Y); } static void Click(int x, int y) { MouseMove(x, y); SendMessage(hWnd, WM_LBUTTONDOWN, (IntPtr)0x1, new IntPtr(y * 0x10000 + x)); SendMessage(hWnd, WM_LBUTTONUP, (IntPtr)0x1, new IntPtr(y * 0x10000 + x)); } Edit: Of course I can use mouse_event for that, but I would like to see a solution for SendMessage()... [DllImport("user32.dll")] static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo); const int LEFTDOWN = 0x00000002; const int LEFTUP = 0x00000004; static void Click(int x, int y) { MouseMove(x, y); mouse_event((int)(LEFTDOWN), 0, 0, 0, 0); mouse_event((int)(LEFTUP), 0, 0, 0, 0); }

    Read the article

  • How to simulate mousemove event from one window to another?

    - by Gohan
    Hello, I am trying to Create an empty window, which process the WM_MOUSEMOVE message in WinProc: case WM_MOUSEMOVE: { HWND otherHwnd = HWND(0x000608FC); POINT pt = {LOWORD(lParam), HIWORD(lParam)}; ClientToScreen(otherHwnd, &pt); PostMessage(otherHwnd, WM_TIMER, WPARAM(4096), 0); PostMessage(otherHwnd, message, wParam, lParam); SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y)); SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y)); SendMessage(otherHwnd, WM_NCHITTEST, NULL, (LPARAM)MAKELONG(pt.x, pt.y)); SendMessage(otherHwnd, WM_SETCURSOR, WPARAM(otherHwnd), (LPARAM)MAKELONG(HTCLIENT, WM_MOUSEMOVE)); break; } I hope I can hover the hyberlink in IE, but result is the hyberlink only be showed as hover style in a very short time, then it turn to normal, and then again hover, then normal. At www.amazon.com, when I simulate to hover the link("Today's Deals ") , the link is blinking. I think there is a better way to do it, even the IE window is covered with some other windows, it can make the IE act with the mouseevent. waiting for the best solution~ orz Above is the spy++ logs when I realy hover the link. and the simulate is as same as the real message <01277> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE <01278> 000608FC R WM_SETCURSOR fHaltProcessing:False <01279> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50 <01280> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000 <01281> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01282> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01283> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01284> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01285> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01286> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01287> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01288> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01289> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE <01290> 000608FC R WM_SETCURSOR fHaltProcessing:False <01291> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50 <01292> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000 <01293> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01294> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01295> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01296> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01297> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01298> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01299> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01300> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01301> 000608FC S WM_SETCURSOR hwnd:000608FC nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE <01302> 000608FC R WM_SETCURSOR fHaltProcessing:False <01303> 000608FC P WM_MOUSEMOVE fwKeys:0000 xPos:406 yPos:50 <01304> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01305> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01306> 000608FC P WM_TIMER wTimerID:4096 tmprc:00000000 <01307> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01308> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01309> 000608FC S WM_NCHITTEST xPos:520 yPos:283 <01310> 000608FC R WM_NCHITTEST nHittest:HTCLIENT <01311> 000608FC S WM_NCHITTEST xPos:521 yPos:281 <01312> 000608FC R WM_NCHITTEST nHittest:HTCLIENT

    Read the article

  • How to set a checkbox to checked state in a ListView using Autohotkey

    - by Itay Levin
    Hi, I am writing a Autohotkey script that need to 'check' and 'uncheck' checkboxes defined inside a listViewControl. I think the way to do it is using a SendMessage to the listview (or maybe to the listview item itself?) using the LVM_SETITEMSTATE parameter but i don't know the exact format...anyone have any idea? SendMessage, LVM_SETITEMSTATE, 1000, SysListView321 i think that 1000 means that the checkbox will be checked and 2000 means that he will be unchecked. do i need to do a loop for each ListViewItem? I had also tried to use the LV_Modify(0, "+Checked") But it doesnt seems to work also. To emphasize the problem, I am not creating my own List View, i'm trying to manipulate the state of an exisiting application ListView.... (i'm running an installer and using the AutoHotKey script i press the next buttons on each of the screens, but in this screen i need to first select all the components and only then move to the next screen) Any AutoHotKey Experts in here?

    Read the article

  • Window screenshot using WinAPI

    - by Evl-ntnt
    How to make a screenshot of program window using WinAPI & C#? I sending WM_PAINT (0x000F) message to window, which I want to screenshot, wParam = HDChandle, but no screenshot in my picturebox. If I send a WM_CLOSE message, all waorking (target window closes). What I do wrong with WM_PAINT? May be HDC is not PictureBox (WinForms) component? P.S. GetLastError() == "" [DllImport("User32.dll")] public static extern Int64 SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); ..... SendMessage(targetWindowHandle, 0x000F, pictureBox.Handle, IntPtr.Zero);

    Read the article

  • Can I get a bitmap of an arbitrary window in another application process?

    - by Chris Farmer
    I am trying to automate a third-party Win32 application where I want to capture the graphics content of a particular window at defined time intervals. I am in the early phases of this, and I'm currently trying to use the Microsoft UI Automation API via C# to do most of the interaction between my client app and the external app. I can now get the external app to do what I want it to do, but now I want to capture the graphics from a specific window that seems to be some third-party owner-drawn control. How can I do this? The window I want to capture is the one marked by the red rectangle in this image: I have an implementation that sort of works, but it's dependent on the external app's UI being on top, and that's not guaranteed for me, so I'd prefer to find something more general. var p = Process.Start("c:\myapp.exe"); var mainForm = AutomationElement.FromHandle(p.MainWindowHandle); // "workspace" below is the window whose content I want to capture. var workspace = mainForm.FindFirst(TreeScope.Descendents, new PropertyCondition(AutomationElement.ClassNameProperty, "AfxFrameOrView70u")); var rect = (Rect) workspace.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty); using (var bmp = new Bitmap((int)rect.Width, (int)rect.Height)) { using (var g = Graphics.FromImage(bmp)) { g.CopyFromScreen((int)rect.Left, (int)rect.Top, 0, 0, new Size((int)rect.Width, (int)rect.Height)); bmp.Save(@"c:\screenshot.png", ImageFormat.Png); } } The above works well enough when the automated app is on top, but it just blindly copies the screen in the rectangle, so my code is at the mercy of whatever happens to be running on the machine and might cover my app's window. I have read some suggestions to send the WM_PRINT message to the window. This question/answer from a few months back seemed promising, but when I use this code, I just get a white rectangle with none of my control's actual contents. var prop = (int)workspace.GetCurrentPropertyValue(AutomationElement.NativeWindowHandleProperty); var hwnd = new IntPtr(prop); using ( var bmp2 = new Bitmap((int)rect.Width, (int)rect.Height)) { using (Graphics g = Graphics.FromImage(bmp2)) { g.FillRectangle(SystemBrushes.Control, 0, 0, (int)rect.Width, (int)rect.Height); try { SendMessage(hwnd, WM_PRINT, g.GetHdc().ToInt32(), (int)(DrawingOptions.PRF_CHILDREN | DrawingOptions.PRF_CLIENT | DrawingOptions.PRF_OWNED)); } finally { g.ReleaseHdc(); } bmp2.Save(@"c:\screenshot.bmp"); } } So, first, is it even possible for me to reliably save a bitmap of a window's contents? If so, what is the best way, and what is wrong with my WM_PRINT with SendMessage attempt?

    Read the article

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

    - by Jorge Branco
    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.com/en-us/library/bb775583(VS.85).aspx NM_DBLCLK http://msdn.microsoft.com/en-us/library/bb774867(VS.85).aspx

    Read the article

  • vb6: set SysTabControl32 by code

    - by Fuxi
    hi, i'm coding a little app for controlling soulseek - what i want do is clicking the "Search Files" button by code. i've got the handle to the tabbed control (SysTabControl32) and managed to change the tab with following code: rc1 = SendMessage(hwnd, TCM_SETCURFOCUS, ByVal 0, ByVal 0&) the problem: the tab control is changing to the proper button, but nothing happens. i assume i also also have to send a mouseclick to it, as when clicking by mouse, the button goes down and up again. any ideas how to do this? thx

    Read the article

1 2 3 4 5 6 7 8 9  | Next Page >