|
prithaa wrote: What exactly LoadFrame(IDR_MAINFRAME) is doing?
Should read the docs first!
From MSDN:
Construct a CFrameWnd object in two steps. First invoke the constructor, which constructs the CFrameWnd object, then call LoadFrame, which loads the Windows frame window and associated resources and attaches the frame window to the CFrameWnd object. The nIDResource parameter specifies the menu, the accelerator table, the icon, and the string resource of the title for the frame window.
Use the Create member function rather than LoadFrame when you want to specify all of the frame window’s creation parameters.
The framework calls LoadFrame when it creates a frame window using a document template object.
|
|
|
|
|
Is there any easy way to print a small triangle that is
pointing to the right? There does not appear to be one
as an ascii symbol. Im wondering if there is any other
way.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
The 52nd character in the Webdings font is a right arrow. Did you try that?
CClientDC dc(this);<br />
CFont fnt;<br />
fnt.CreatePointFont( 200, _T("Webdings"));<br />
TCHAR t = 52;<br />
dc.SelectObject( &fnt );<br />
dc.TextOut( 0,0, &t, 1 );
nave
|
|
|
|
|
my application want to response an action like the windows screen saver.
it means if there is no operation on your keyboard or mouse for 5~10min, then i want to get these action to do something.
the idea in my mind is to use the Keyboard hook and Mouse hook. so that can monitor the operation on Keyboard or Mouse. but it looks not a good solution.
This problem looks like the Screen Saver action. who knows is there have some API or other easy way to solve it?
thank!
|
|
|
|
|
Handle the WM_SYSCOMMAND message and look for the SC_SCREENSAVE as wparam.
nave
|
|
|
|
|
i want to set the sleep time in my program, but not accordin the Windows Setting.
and i don't want to see the Windows Screen Saver run~
how?
|
|
|
|
|
How about calling the SetPriorityClass() with the IDLE_PRIORITY_CLASS parameter?
you can get the idle time since the user's last activity using the GetIdleMinutes() API. May be u can put a timer of 1 minute and when the timer fires check whether the ideal time you need is reached.
nave
|
|
|
|
|
i just find these functions in MSDN.
the funcion DWORD GetIdleTime (void); and HRESULT GetIdleWait(WORD *pwIdleMinutes, WORD *pwDeadlineMinutes); both need include "Mstask.h".
but i found this header files is in the WinCE SDK.
my application is under Win XP/2000.
|
|
|
|
|
jakeyjia wrote: GetIdleTime
try GetLastInputInfo() function.
nave
|
|
|
|
|
thank you~ i got it~
note: in VC 6.0 must define the version like:
#define _WIN32_WINNT 0x0500
|
|
|
|
|
jakeyjia wrote: thank you~ i got it~
jakeyjia wrote: note: in VC 6.0 must define the version like:
#define _WIN32_WINNT 0x0500
_WIN32_WINNT denotes the verison of windows you use. And if you are using XP it is 0x501
nave
|
|
|
|
|
I'm trying to set a parameter through WMI.
I can read a value as follows:
IEnumWbemClassObject* pEnumerator = NULL;
hres = pSvc->ExecQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM CIM_VideoController"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator);
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,
&pclsObj, &uReturn);
hr = pclsObj->Get(L"CurrentHorizontalResolution", 0, &vtProp, 0, 0);
But when I try to do a set as follows:
V_VT(&v) = VT_I4;
V_I4(&v) = 1024;
hr = pclsObj->Put(L"CurrentHorizontalResolution", 0, &v, VT_I4);
I get an error return value of: 0x80041005
Any guidance woudd be appreciated!
Jeremy
|
|
|
|
|
CIM_VideoController::CurrentHorizontalResolution
<br />
Data type: uint32<br />
Access type: Read-only<br />
Current number of horizontal pixels.<br />
so you can't set it by put method.
you can see more info in MSDN: http://msdn2.microsoft.com/en-us/library/aa388668.aspx[^]
|
|
|
|
|
Thanks -- I should have noticed the access-type. So, it seems that this stunning complicated wmi interface is just to get stuff.
So, back to ChangeDisplaySettings. I'll post another question on that!!
Jeremy
|
|
|
|
|
If I use SetWindowsHookEx() with the idHook argument as WH_CALLWNDPROC, if I want this to be a global hook and monitor messages to ALL windows in the current desktop, do I have to place the hook procedure defined in lpfn in a DLL? Also, if I want it to be a global hook, do I just set hMod to NULL and dwThreadId to 0?
Thanks for your help!
--PerspX
|
|
|
|
|
Perspx wrote: do I have to place the hook procedure defined in lpfn in a DLL
yes you need to put it in a dll.
Perspx wrote: do I just set hMod to NULL and dwThreadId to 0?
no hMod must specifiy the HINSTANCE of the dll. dwThreadId should be 0.
nave
|
|
|
|
|
Thank you very much
--PerspX
|
|
|
|
|
I don't really know exactly what this is called, so that may be why i haven't found any good information about it.. From one of my programs (a VC6.0 dialog based MFC application) i want to be able to check checkboxes, slide sliders etc of other MFC dialog based applications. Im not sure if its possible, but i would guess that it is since other programs can like hide windows and stuff. Is there a nifty way to do so in c++? (except for cheapy ways like moving the mouse and clicking by code)
Like CheckBox(SomeWindow, SomeName, 1); :P (i know it can't be that easy, but in general..)
Anybody have any experince with this, know what it might be called or have any urls?
Since i dont have anything to work with right now i am open to any information
thanks
//Johannes
|
|
|
|
|
Such a thing is possible if you first obtain the window handle of the checkbox, slider, etc., and then use SendMessage() to send window messages to it.
The hardest thing about this is determining the exact window to which you want to send the messages.
Keep in mind that in Vista, your manipulator app has to have high enough "integrity" to send messages to other processes.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
You could use the EnumWindows() API to search for all of the windows that are open, then when you have found the right window, you could use the FindWindowEx() API to find the right child window owned by the window returned by EnumWindows(). Then, as said above, you could use the SendMessage API to send the designated message to the window.
Hope this helps!
--PerpspX
|
|
|
|
|
in addition to what Perspx said, you can use GetDlgItem() or EnumChildWindows() to get each controls in a dialog and then use GetClassName() to find which control it is.
nave
|
|
|
|
|
Thanks for the help
So im looking at the SendMessage, FindWindow and FindWindowEx, but im having trouble connecting them all,
I declare a HWND to "hold the window".
FindWindow("Control", 0); //Makes it so my program has control to the window called "Control" ?
Then i have to use FindWindowEx to set which dialog radio buttons /checkboxes should be set and to what
then SendMessage() to set it?
Might you know how i would connect these? Or is the some nice tutorial somewhere :/
thanks
//Johannes
|
|
|
|
|
Hi all,
I am trying to convert MFC code to Borland 6 C++.
I have never done programming in MFC. So facing bit problem. Well firstly i would like to know whether in MFC we can drag and drop the tool bars...well i am trying to view design of the form but i dont see any option and i cant view it...
The project is created on earlier version of VStudio as i am using VS2005. Is there much difference ?
Because i am getting few exception when i run this project on vs2005.
OK secondly when i am trying to step through this mfc application . After pressing F10 i get the appmodul.cpp file and it just step through one or two lines and run the whole application. How can i step through the whole program...Break point isnt helping me out.
Thirdly i have got this function class_def::abc(CProgressCtrl *pp) to get the progress bar working with addition of SetRange, SetStep and SetPos functions.
In Borland there is this TProgressBar option i guess. But if i just write TProgressBar in place of CProgressCtrl i get error i.e.[ } expected]. And what replaces the SetRange,SetStep, and SetPos functions...
Any or all help would be greatly appreciated.
Thanks
SS
|
|
|
|
|
VC6 -> VC2005 is a huge difference, VC6 was not very standards compliant at all. MFC has not changed that much, however.
Software_Specialist wrote: How can i step through the whole program...Break point isnt helping me out.
Run in debug mode ?
Software_Specialist wrote: But if i just write TProgressBar in place of CProgressCtrl
Obviously if they are different classes, they will expose different methods and you will get errors.
Moving from one framework to another is essentially a rewrite.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i am using picturebox to create visual buttons, but i want the picturebox has tabstop property, how can i do?
any api function ??
|
|
|
|