|
kendao wrote: Do you know how to simulate a left button mouse click on another application ? (use SendMessage api ?)
Better Use mouse_event Function or SendInput function for Simulating mouse on your or other window
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi, How a window exract text from another window(eg: MSWord,Excel..).Is there any API to exract text. Or there is any other way to exract. If any one has answer please help me.
For eg: Capturing tools like SnagIt captures from different window. I want to know how do these capturing tools like SnagIt do it.
Jewel Nandy,
Mumbai,India
|
|
|
|
|
Try FindWindowEx() to find the main window, then use it again passing the main window as the parent, and it will go through the child windows one at a time. Maybe that'll be a start. I think the first time you have to pass a null as the parent window's handle and just specify the window caption.
My articles
BlackDice
|
|
|
|
|
Jewel Nandy wrote: How a window exract text from another window(eg: MSWord,Excel..).Is there any API to exract text. Or there is any other way to exract. If any one has answer please help me.
Have a look at this article :-
http://www.codeproject.com/threads/winspy.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
I speak of the class std::queue / #include <queue>
In my case the question is:
1. Is it safe to execute m_queue.push from thread A,
while thread B executes m_queue.pop ?
2. Is it safe to execute m_queue.push from thread A,
while thread B executes m_queue.empty ?
3. Is it safe to execute m_queue.push from thread A and also from thread B?
I hope you understand what i mean,
thanks in advance
Snow.
|
|
|
|
|
None of the STL objects are thread safe. Wrap the calls in critical sections.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks for your answer Tim.
I found an MSDN article "Thread Safety in the Standard C++ Library" which statet that some of the STL
container classes are threadsafe (but only in certain cases). But I think it will be better to write a wrapper for the queue class as you wrote before. It seems to be the only way to be on the safe side.
Thanks,
Snow.
|
|
|
|
|
I have on my form one Clist Control And One Button so that when I click on it, I see my data.
But my problem is this, every time I click on this button, the number of columns on my CList control is increasing. How can I avoid this problem
I learn my self
|
|
|
|
|
You probably keep inserting the column over and over again.
You need to completely clear out the control, or else set up the columns in OnInitDialog and don't keep adding the columns over again. You can add data items to the existing columns separately - when your button is pressed.
|
|
|
|
|
|
Dear ALL,
I would like to add a menu to my starting dialog window using WinAPI (I know how to do it with MFC). The code until now looks like I attached it at the end of the message.
But I dont know how to modify the "DialogBox(hInstance,MAKEINTRESOURCE
(IDD_MAIN), NULL, DlgProc);" - command to make it include my menu "IDR_MENU1" from the "resource.h"-file also.
Thanks for your comments.
FRANK REICH
<br />
#include <windows.h><br />
<br />
#include "resource.h" <br />
<br />
HBRUSH g_hbrBackground = NULL;<br />
<br />
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch(Message)<br />
{<br />
case WM_INITDIALOG:<br />
g_hbrBackground = CreateSolidBrush(RGB(180, 180, 180));<br />
<br />
SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(NULL, <br />
MAKEINTRESOURCE(IDI_APPLICATION)));<br />
SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(NULL, <br />
MAKEINTRESOURCE(IDI_APPLICATION)));<br />
break;<br />
<br />
case WM_CLOSE:<br />
EndDialog(hwnd, 0);<br />
break;<br />
<br />
case WM_CTLCOLORDLG: <br />
return (LONG)g_hbrBackground;<br />
<br />
case WM_CTLCOLORSTATIC:<br />
{<br />
HDC hdcStatic = (HDC)wParam;<br />
SetTextColor(hdcStatic, RGB(255, 255, 255));<br />
SetBkMode(hdcStatic, TRANSPARENT);<br />
return (LONG)g_hbrBackground;<br />
}<br />
break;<br />
case WM_COMMAND:<br />
switch(LOWORD(wParam))<br />
{<br />
case IDOK:<br />
EndDialog(hwnd, 0);<br />
break;<br />
<br />
case IDCANCEL:<br />
EndDialog(hwnd, 0);<br />
break;<br />
}<br />
break;<br />
case WM_DESTROY:<br />
DeleteObject(g_hbrBackground);<br />
break;<br />
default:<br />
return FALSE;<br />
}<br />
return TRUE;<br />
}<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
LPSTR lpCmdLine, int nCmdShow)<br />
{<br />
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc);<br />
}<br />
|
|
|
|
|
Frank Reich wrote: would like to add a menu to my starting dialog window using WinAPI (I know how to do it with MFC). The code until now looks like I attached it at the end of the message.
But I dont know how to modify the "DialogBox(hInstance,MAKEINTRESOURCE
(IDD_MAIN), NULL, DlgProc);" - command to make it include my menu "IDR_MENU1" from the "resource.h"-file also
Attach the Menu Directly to the Dialog Box.. you will option of that on right clicking on the dialog box resource
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
1. when windows sends WM_QUERYENDSESSION message to the applicaitons at logoff, does it send it to all at once or send it to the applications one by one?
2. does it send it to the apps in any specific order or is it undefined?
3.
thanks!
|
|
|
|
|
|
Sphere ++ wrote: 1. when windows sends WM_QUERYENDSESSION message to the applicaitons at logoff, does it send it to all at once or send it to the applications one by one?
It is send to all the top level window simultaneously
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
How do I get the list of subfolders under the recycle bin directory C:\RECYCLER (which I get querying for CSIDL_BITBUCKET)? And how do I know which drive those subfolders refer to?
thanks!
|
|
|
|
|
|
Is it prossible to create a MemDC without a screen or printer DC to base it on.
I have an MFC program that I want to be executed by a web service. The program writes to a DC and then saves the bitmap.
If I run this program from a web service, presumably there is no window to base the DC for the bitmap to draw on. so I jsut want to create a Mem DC to draw on.
If I want to draw on say a 1024x1024 bitmap with a bit depth of of 32 bits.
How can I do this?
Bbly
|
|
|
|
|
Use the desktop DC. I have a graphing library running as a web service doing exactly what you describe and it works great.
Snippet of code that sets up the DC:
CRect oBmpSize(0,0,lWidth,lHeight);
oMemDC.CreateCompatibleDC(NULL);
int iOldMapMode = oMemDC.SetMapMode(MM_TEXT);
CWindowDC dcScreen(NULL);
oBmp.CreateCompatibleBitmap(&dcScreen,oBmpSize.Width(), oBmpSize.Height());
pOldBmp = oMemDC.SelectObject(&oBmp);
onwards and upwards...
|
|
|
|
|
|
I think you should be able to use SetRedraw() turning it off while sizing, then turning it back on when finished.
My articles
BlackDice
|
|
|
|
|
Hi
Anybody has a VC++ sample code for an ActiveX control to be viewed via IE browser that is capable of downloading a file (say via winsock or http api) from the website where it is hosted?
thanx in advance
|
|
|
|
|
hi
you can build ActiveX control with MFC ActiveX control wizard.so it is not a big deal.
main thing is to show it in browser.
for that you have to sign your activeX control.other wise it wont be shown due to default security settings of the browser wont let it(unsigned ActiveX control) execute.
to sign your control for testing purpose you can use codesigning SDK.
sanket patel
|
|
|
|
|
I am getting this error by compiler when I compile my code in VC.NET. Note it was previously compiled correctly in VC 6.0 .
e:\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxdlgs.h(430): error C2146: syntax error : missing ';' before identifier 'm_pdex'
Any reason. I shall be very grateful.
Best Regards,
|
|
|
|
|
Hi,
In stdafx.h
Try changing WIN_VER to 0x0501, which is Windows XP and 2003 specific.
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|