Prev: Best way to use CAsyncSocket.
Next: Tri-state status for CListCtrl with LVS_EX_CHECKBOXES style
From: Tom on 13 Nov 2009 17:54 I need to read the text in the status bar of another application. The status bar class is Afx:StatusBar:400000.xxxx, so I guess it's the MFC CStatusBar object. I have an existing piece of code that can read standard Windows status bars (class: msctls_statusbar32) fine. This piece uses SendMessage (SB_GETTEXT) as follows: - Length=SendMessage(hStatusbar, SB_GETTEXTLENGTH, Index, 0); // Get the length of the text - Allocate the buffer based on Length - SendMessage(hStatusbar, SB_GETTEXT, Index, (LPARAM) Buffer); // Index = the pane number of the status bar to retrieve the text // Buffer = the place to store the text (I've omitted all details about allocating memory in the remote process and copy data back and forth). However, it doesn't seem to work with the Afx:StatusBar (as said earlier, it worked for msctls_statusbar32). I would really appreciate it if someone could tell me how to get the text in CStatusBar. Thanks a lot
From: Kerem Gümrükcü on 16 Nov 2009 00:46 Hi Tom, try to enmuerate the Windows Child Forms and Controls and try to determine which one is what you are looking for: Use these functions for that: EnumChildWindows / FindWindowEx GetClassName / GetClassInfo Check the class nam and make a decision by properties like e.g class name itself, position, objects paren, etc.,...this is up to you! Regards Kerem -- ----------------------- Beste Gr�sse / Best regards / Votre bien devoue Kerem G�mr�kc� Latest Project: http://www.pro-it-education.de/software/deviceremover Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "Tom" <nt727201(a)yahoo.com> schrieb im Newsbeitrag news:3d1fd5ac-db31-41f7-987e-b7ee1ae679b5(a)s31g2000yqs.googlegroups.com... > I need to read the text in the status bar of another application. The > status bar class is Afx:StatusBar:400000.xxxx, so I guess it's the MFC > CStatusBar object. > > I have an existing piece of code that can read standard Windows status > bars (class: msctls_statusbar32) fine. This piece uses SendMessage > (SB_GETTEXT) as follows: > > - Length=SendMessage(hStatusbar, SB_GETTEXTLENGTH, Index, 0); // Get > the length of the text > - Allocate the buffer based on Length > - SendMessage(hStatusbar, SB_GETTEXT, Index, (LPARAM) Buffer); > // Index = the pane number of the status bar to retrieve the text > // Buffer = the place to store the text > > (I've omitted all details about allocating memory in the remote > process and copy data back and forth). > > However, it doesn't seem to work with the Afx:StatusBar (as said > earlier, it worked for msctls_statusbar32). > > I would really appreciate it if someone could tell me how to get the > text in CStatusBar. > > Thanks a lot
|
Pages: 1 Prev: Best way to use CAsyncSocket. Next: Tri-state status for CListCtrl with LVS_EX_CHECKBOXES style |