|
YourWindow *wnd = (YourWindow *)pParam;// You should pass the handle of the window as pParam
Here what means YourWindow
Beacuse I am able to get the active window I am not able to get device context.
will you please explain me what you mean by your window.
I tried long journey of HWND hwnd = :: GetActiveWindow()
then CDC tempdc = (CDC*)( ::GetWindowDC(hwnd));
but it also proved hopeless.
|| ART OF LIVING ||
|
|
|
|
|
Hi
I am popping a default mail client with an attachment for sending the mail in my application.I used a dll which inturn used Mapi.I could successfully popup the default mail client when Eudora,Outlook express are set as default mail clients but when i set MSOutLook 2003 as default i could not.
Any Suggestions or links would be useful for me.
Thanx
|
|
|
|
|
A CWnd based class creates a popup window:
BOOL b=CreateEx(0,0,0,WS_POPUP|CHILD,rc,pMum,100);
in XP, the call failed, by in 98 and other OS, the call is OK.
how to solve the problem for XP?
|
|
|
|
|
Can you be more specific do you get error
whitesky
|
|
|
|
|
|
BOOL o=CWnd::CreateEx(0, AfxRegisterWndClass(0), "CTest1", WS_POPUP, 0,0,0,0, NULL, 0);//return 1
whitesky
|
|
|
|
|
WS_POPUP and WS_CHILD flags do not go together. Only pass WS_POPUP with valid parent window handle.
GJ
|
|
|
|
|
|
Hi friends,
we try to use port forwarding concept in our application. freinds is their any software for port forwarding is available , so that we will use it in our application. or any sample code for port forwarding is available , so we will study that code and try to use in our application. If any links regarding port forwarding is ezists , provide us. frinds kindly give us reply.
regards
Girish
Software Developer
|
|
|
|
|
Port forwording is done by firewall automatically(u have to write rules).So what is ur purpose.
never say die
|
|
|
|
|
Hi,
I request u to kindly ans :
"How to place an edit box and dialog box on a window(SDI)( MFC based application)in VC++ dot Net-2003 version".
Thank you very much.
|
|
|
|
|
Change to Resource View, then change into the Dialog-Folder and edit the Dialog.
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hi
How can I get HWND from a process HANDLE?
|
|
|
|
|
Hadi Dayvary wrote: Hi
How can I get HWND from a process HANDLE?
You have to Enumerate all window on desktop and compare each Processs handle to that Enumerated Window Process Handle!
"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
Support CRY- Child Relief and You
|
|
|
|
|
So how to get process HANDLE from a HWND?
|
|
|
|
|
Hadi Dayvary wrote: So how to get process HANDLE from a HWND?
How about GetWindowThreadProcessId() ?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Use the following code
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)<br />
{<br />
EnumInfo info;<br />
DWORD pid;<br />
EnumWin * enumWin =<br />
reinterpret_cast(lParam);<br />
GetWindowThreadProcessId(hWnd, &pid);<br />
<br />
if (pid == enumWin->m_pid)<br />
{<br />
if(GetParent( hWnd ) == 0)<br />
{<br />
enumWin->m_found = TRUE;<br />
enumWin->m_hwnd = hWnd;<br />
AfxMessageBox("handle found!");<br />
return FALSE; <br />
}<br />
}<br />
return TRUE;
}
you can use WaitForInputIdle(...) for the process to finish initializing before you try to find its HWND. this will not work with apps that start with a process and switch to another while excuting (e.g. mozilla fire fox).
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I have an issue that requires either the rotation of the application (MFC Doc/View architecture - yes i know but it's a legacy application) or the screen (ATI Radeon). I've tried using the ChangeDisplaySettings API call (it does this already to set the required resolution, and yes I know this is a bad thing generally but this project requires the switching of two legacy applications both of which are EPoS and the operator is trained and paid to put up with it) and setting the rotation flag to DM_180 but I always get a DISP_CHANGE_BADMODE.
So I have a display on a hinge, and one application (the doc/view one) ends up being upside down. The ATI card has a tray application which lets the display be flipped, but I can't how to do it using API calls, or even calling into an ATI dll. (The ATI card isn't guaranteed to be used throughout the life of the project, it could well be replaced by another make/model). Unless some clever person out there can tell me how to rotate the display programically, the only other way is to add some code so that the output of the doc/view application is inverted.
Does anyone have any ideas?
Andy
|
|
|
|
|
No idea if that works, but you can try SetWorldTransform in the OnPaint event of your view, maybe in the frames.
|
|
|
|
|
Thanks, I gave that a go just now on one of the dialogs and managed to rotate the background but none of the controls on the dialog. I suspect I would have to override the onpaint events for absolutely everything, which for a new application could be a fun flag for the registry but for a crusty old legacy app it's not happening.
Andy
|
|
|
|
|
Hi,
I want to change the icon of my application,so, i changed it in resource file and the exe created with new Icon itself.But my problem,after running the EXE, the system taskbar which shows the icon and application name...IN THAT THE ICON IS OLDER ONE.IT DOES NOT SHOW THE NEW ICON.
I dont know wat to do.The res file and ICON in the Workspace,all shows the new Icon only.Even my EXE in Debug file also shows new Icon.But in system taskbar shows the older one.
-- modified at 7:53 Wednesday 31st May, 2006
|
|
|
|
|
Do you use SetIcon
whitesky
|
|
|
|
|
Till now i wont use SetIcon but the taskbar shows right icon,then now why it does not shows the new one.where the application takes the old icon.because i checked in all files there is no older icon.then how its possible?Pls clear my doubts.
|
|
|
|
|
Please see Michael Dunn answer and my guess 16x16 icon
whitesky
|
|
|
|
|
change both be 32x32 and 16x16 icon.
in task bar 16x16 icon is displayed.
see your application exe in windows explorer both in Large icon setting and Small icon setting
Regards
Anil
|
|
|
|