|
I simply can't remember it.
THanks in advance.
|
|
|
|
|
see GetDeviceCaps. you can get resolution, DPI, etc..
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
::GetSystemMetrics(SM_CXSCREEN);
::GetSystemMetrics(SM_CYSCREEN); or
::GetDeviceCaps(::GetDC(NULL), HORZRES);
GetDeviceCaps(::GetDC(NULL), VERTRES);
|
|
|
|
|
I'm not sure, but shouldn't you be using ReleaseDC on the screen dc returned by GetDC(NULL) ?
Cheers, Marc Click to see my *real* signature
|
|
|
|
|
I need to restrict the resizing of the SDI application.
I tried the method found in
http://www.codeproject.com/useritems/mdibackgroundimage.asp
to hook on to WM_SIZING and it worked.
But i was wondering whether there was any other way, any msg i could overload?
tried all the PreTranslateMessage and ProcessMessageFilter message map, but it did'nt work.
This is a slightly modified one from winamp plugin.
very slightly. i just wanted
WNDPROC pfnOldWndProc;
LRESULT CALLBACK pfnNewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam,LPARAM lParam)
{
CRect rect;
switch (uMsg) {
case WM_SIZING :
if ((wParam==WMSZ_BOTTOMLEFT) || (wParam==WMSZ_BOTTOMRIGHT))
wParam=WMSZ_BOTTOM;
else if ((wParam==WMSZ_TOPLEFT) || (wParam==WMSZ_TOPRIGHT))
wParam=WMSZ_TOP;
GetWindowRect(hwnd,rect);
((RECT*)lParam)->left= rect.left;
((RECT*)lParam)->right = rect.right;
break;
}
return CallWindowProc(pfnOldWndProc, hwnd, uMsg, wParam, lParam);
}
and in InitInstance()
HWND hMain = GetActiveWindow();
pfnOldWndProc = (WNDPROC)GetWindowLong(hMain, GWL_WNDPROC);
SetWindowLong(hMain, GWL_WNDPROC, (long)pfnNewWndProc);
|
|
|
|
|
aldeba wrote:
I need to restrict the resizing of the SDI application.
WM_MINMAXINFO is what you need
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Ur Requirement is to limit resizing.
U should go for the message WM_GETMINMAXINFO.
OnGetMinMaxInfo(MINMAXINFO *mmi) message handler, mmi->ptMaxSize, mmi->ptMaxTrackSize, mmi->ptMaxTrackSize are the relevent member to be filled to limit resizing.
mmi->ptMaxTrackSize is SIZE u want to restrict.
|
|
|
|
|
Hi,
I have application thread ID with me. How can I find out the Application main window handle from it ? I have a c# toolbar as a window inserted in the application sharing same thread ID. What should I do?
VIKS
|
|
|
|
|
Hi,
I have application thread ID with me. How can I find out the Application main window handle from it ? I have a c# toolbar as a window inserted in the application sharing same thread ID. What should I do?
VIKS
|
|
|
|
|
Hi ,
I just want some technical document stating how VC++ treats JPEG images.
Thanks
Sutanu
Sutanu Lahiri
Software Engineer
Calcutta, India .
|
|
|
|
|
VC++ doesn't care about JPGs. GDI+ does, and there are many classes on this site that do.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
I want to use ActiveMovie (ocx) to play mp3 in my program.
I use it as follow:
// CFileDialog dlg(TRUE,"mp3",NULL,OFN_HIDEREADONLY,NULL,NULL);
if(dlg.DoModal ()==IDOK)
{
CString pathname=dlg.GetPathNmae();
m_MusicPlayer.SetAutoStart (TRUE);
m_MusicPlayer.SetFileName( pathname);
}
But every time I open the mp3,the program will exit auotmatically.
I trace the program and found that when the program run to
m_MusicPlayer.SetFileName( pathname);
the program will quit.
I don't what cause this.
And I use Windows Media Play 8!
Thank you for help!
Don't look at me in that way!
|
|
|
|
|
Hi.
There are some applications (not only from Microsoft), which allow users to write and execute macros in Visual Basic. I would like to include feature like this in my program written in Visual C++. How to do this? (any source code examples?, URL's to documentation?)
Greets,
Juntek
|
|
|
|
|
Check out the MSDN documentation for IActiveScript . This is how most apps do it I believe. It requires that you make all your 'scriptable' objects into COM objects. IActiveScript supports JavaScript and VBScript among others (actually it supports whatever script engine you have installed)
Also check out IActiveScriptParse, which is the easiest place to start.
|
|
|
|
|
I am really desesperate! I stop in this problem 1 month ago!
I must scroll another window the same horizontal pixels amount. I receive EN_HSCROLL notifications but the informaton provided by GetScrollInfo() is meaningless.
Could anybody help me?
Miguel Fonseca
miguel.fonseca@xerus.pt
|
|
|
|
|
I have been using the memory watch window a lot lately when debugging and it leaves a lot to be desired. I'd really like to be able to watch more than one memory location at a time, and to get wide strings displayed properly, because I often look up XML which is in a _bstr_t. So I'd like to write my own memory watching tool to use while debugging. The question is, if I do this, as a seperate process, how can I view memory with impunity and not crash my app from trying to access memory I do not own ? Being able to write to it would be nice, but if all I can do is read, that would cover 99% of what I'd like to achieve.
Any hints ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Either make a module and recompile the kernel or use the IDebugger interface. (I've never used it myself, so an extensive article about it would be appreciated )
|
|
|
|
|
Could you tell me more ? IDebugger does not come up in MSDN.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
MSDN October 2000 wrote:
...
With the Debugger object, you can inspect the processes being debugged in Developer Studio.
...
The Debugger object implements the IDebugger dual interface. Through this interface, add-ins can directly access the members (properties, methods, and events) of this object and can employ early binding to make calls into these members faster at run time.
Add-ins written in Visual C++ can access members of the Debugger object by using the header files in Vc98\Include\objmodel. However, if you use the Developer Studio Add-in Wizard to create an add-in, the wizard automatically includes these header files in your source code.
...
I'll try to get some more info and get back.
|
|
|
|
|
There are a number of format codes that you can use in the normal watch window which may give you some of what you want.
For instance, if you know the address of a memory block that you want to view (for example, memory at 0x01f0000), you can enter in the watch window something like:
0x01f0000,m
This will display 16 bytes of memory at the location 0x1f0000.
ma = 64 ASCII characters
m = 16 bytes hex, followed by 16 ASCII
mb = 16 bytes hex, followed by 16 ASCII
mw = 8 words
md = 4 double words
mq = 2 quad words
mu = 2-byte characters (unicode)
In addition, su displays a unicode string.
You can get the rest of the watch window or Quick watch codes under "Symbols for Watch Variables"
Best regards,
John
|
|
|
|
|
Anyone knowns how to get the IGPEInformation interface?
Seems not to be implemented by any object.
Or, is my fear that I have to implement this interface right?
Vote against software patents in europe
|
|
|
|
|
Hi all,
I'm using the WinInet api to download a file from an ftp server which works fine. What does not work fine however is that when (for testing purposes) I kill the connection (both data and control channels) or shutdown the server FtpGetFile() does not return an error like it should.
I also tried to use FtpOpenFile() and InternetReadFile(). This method downloads files fine. However it displays the same probs: when i kill the connection, etc InternetReadFile returns TRUE.
In all cases both GetLastError and InternetGetLastResponseInfo are returning 0, i.e. no error.
Is there some way I can detect when a download has failed (either when using FtpGetFile or InternetReadFile) short of writing an ftp client or comparing the file sizes (a very inelegant solution).
10x for ur help
|
|
|
|
|
Me and my friend were having a discussion abt when a class can be called a wrapper class..
eg:
Class CA
{
void SenttoPort(char * tstr);
}
Class CB: Class CA
{
void SendFrame(char Header, char Tail, char Body);
}
void CB::SendFrame(char Header, char Tail, char Body)
{
// format the header tail and body into one string
// temp = header + body+tail
Sendtoport(temp);
}
My doubt is , if a class (CB) is derived from another class (CA), and uses the member function of the parent class (CA), in a member function of its own which accepts different parameteres depending upon the problem domain,(as in the function SendFrame()), can we call the class (CB) as a Wrapper Class of class CA.
Please answer this question and if you can't understand the prob I face please define as to when we can call a class a wrapper of another class.
If you want a helping hand, you'll find one at the edof your arm.
|
|
|
|
|
In my understanding, a wrapper class is one that provides an emulation of the interface for one class, but using the code for another.
For example, back in the days that 3dfx graphics cards were popular, many people created "glide wrappers" which provided a dll with the same interface as the 3dfx graphics card libraries (called glide), but translated the calls into something that could run on a machine without a 3dfx card (opengl, directx, or the api functions for a different chipset)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
A wrapper class usually in my mind is a class that wraps existing functionality. For example, CDC is a wrapper class - it wraps the functionality we get using HDC's and Win32 API functions into a class object.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|