|
I am writing a program to customize your desktop using the Windows Plus! Settings. The only way I could find to do so is to change the registry settings manually and then do a ChangeDisplaySettings with CDS_UPDATEREGISTRY as a flag.
This 'tricks' the settings into being active. There's got to be a better way to do this! Anyone know how to change these settings more efficiently? Does there exist an API that allows you to refresh your display without making a "ChangeDisplaySettings" type change?
OS: Windows NT
Thanks!
|
|
|
|
|
I'm attempting to use a bitmap of a grey shaded sphere as sort of a stamp. I would like to draw to a CDC and PatBlt it to get a shaded sphere of the desired color. I'm running into problems with the number of colors displayed (about 20). I've played around with the CDC's palette but can't get any different results. Any suggestions?
|
|
|
|
|
Is it possible to insert a normal menu in a dialog window ??
I only got it working for an SDI or MDI application.
Thanx for any help,
Wolfgang
|
|
|
|
|
I had the exact same question. Someone sent me some of their code when they had to do the same thing. I never used it because I found a better way to make my app, but if you give me your e-mail, I can forward the code to you.
- John
- johnu@emersonprocess.com
|
|
|
|
|
I don't know exactly what you mean, but perhaps this helps:
Open the properties of your dialog and there select a menu-resource
which the dialog shall use. hth.
|
|
|
|
|
In the resourceView tab, Only select in the properties of the dialog, in the tab General, in the combo Menu, the menu that you want in your dialog.
Cheers
Carlos Antollini.
|
|
|
|
|
Thanks to everybody for helping me
Wolfgang
|
|
|
|
|
You know how if one selects multiple files in Explorer and then begins to drag them, an onscreen representation of those files is visible? I want to do something similar to that (not using a common control) an am trying to figure out the best method. I don't believe CreateCurosr will do, because one is limited to the system metrics for cursor size. Does anyone have an idea as to how the drag images larger than the 'standard' size are created in Explorer?
TW
|
|
|
|
|
Check CListCtrl::CreateDragImage or LVM_CREATEDRAGIMAGE if you play directly with API.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks for your input, but as I mentioned in the original post, I am not using a common control such as the List View. I know I'll have to use the API directly, I'm just looking for some non-MFC, non-Common Control ideas of where to start.
TW
|
|
|
|
|
Oops, sorry for the listview reference. Anyway, the easiest way is to follow the listview. It uses imagelist for drag'n'drop. You can 'manually' use imagelists, the functionality is exposed at the API level:
ImageList_SetDragCursorImage
ImageList_BeginDrag
ImageList_DragMove
ImageList_DragLeave
ImageList_EndDrag
ImageList_GetDragImage
Look at the 'Dragging Images' section in the 'Image Lists' at MSDN.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi,
Thanks for all of your reply about my question before. THANK YOU VERY MUCH!!!!
I try to keep posting my question, so that someone new can see this question and tell me how to fix it....
My major problem is: I have a program that was implemented in NT before and now want to transfer to Win9x. Everything is fine in NT, but in Win9x after the program has run for awhile, the output font change...include the system message box ( i know it because there is a message box ask me to terminate the program..haha..)......but it takes awhile to see the problem........when i do drawing....the problem happened immediately.....( not just draw a line......but a heavy drawing....).....cannot display colour....etc...
I posted this question in codeproject.....and many people told me it would be a GDI resource leak....but i don't know how to fix it....
Oh...give you more backgrounds......it is a program using MFC...........and has a CDC global pointer to let other files to do drawing too...(not in view.cpp only....).....I'm just used some liked CPen or CBrush...then selectobject.....then something liked LineTo or MoveTo.....
Thanks for your help.....
Richard
|
|
|
|
|
I posted this advice before, and I repeat it: you should get rid of the global DC. Just pass the CDC pointer from OnDraw to functions defined in other .cpp files.
Your GDI leaks are (most probably) caused by the fact that pens, brushes and other GDI objects can't be freed when selected into any device context.
void Leak(CDC *pDC)
{
CPen pen(...);
pDC->SelectObject(&pen);
}
CPen's destructor will call ::DeleteObject for you, but it will fail - your pen is still selected. You should re-select before exiting the function:
void TheRightStuff(CDC *pDC)
{
CPen pen(...);
CPen *oldPen = pDC->SelectObject(&pen);
pDC->SelectObject(oldPen);
}
Tomasz Sowinski -- http://www.shooltz.com.plC
|
|
|
|
|
Oh.....i understand that now......let me try....
Thanks, Tomaxz.......
THANK YOU THANK YOU THANK YOU!!!!!;P
|
|
|
|
|
I'm working on an application that talks to a device connected through the serial port. Is there anyone who has done this before and is willing to let me use their code as a reference?
Thanks.
- John
- johnu@emersonprocess.com
|
|
|
|
|
Take a look at this:
http://msdn.microsoft.com/library/default.asp?URL=/library/wcedoc/wcecomm/serial_8.htm
In the "PortReadThread (LPVOID lpvoid)" function they specify a set of events to be monitored for the port, then re-specify them inside the while loops. Is this necessary, and why is it done?
?!?
error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'
Thanks.
- John
- johnu@emersonprocess.com
|
|
|
|
|
ONE approach is using the ActiveX component 'MSComm'. I'm helping somebody else through this component the last couple of weeks, so just search this forum on MSCOMM and you will find some tips and hints...
If you find out a better way of talking to the serial port (or rather, a modem behind it!), please let me know!
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Hi !
Where can I found a source code for an Identify Structure file format ?
I need a function for detect file formats, like: EXE (PE Win32), EXE (DOS), COM, TXT, etc... not check the extension... but, check the internal file format.
IdentifyStructure( char * cFile, char * cReturnFileType )
Thanks
|
|
|
|
|
www.wotsit.org
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Hi !
I know this website...
But I need a ready source code...
Thanks
|
|
|
|
|
In unix/linux, a utility called "file" allows you to do just this. It is gpl'ed so you will be able to get the source somewhere. Dunno where though. look about for it.
|
|
|
|
|
|
Thanks
I´m test this program now...
I send the result to here...
Thanks
|
|
|
|
|
I think, open a file in binary mode and check the header for the type of that file. The formats can be obtained from sites like http://www.wotsit.org/
It must work.
|
|
|
|
|
How can I check, if the CD-Tray is open?
Normally I have to send a mciSendCommand with MCI_STATUS / MCI_STATUS_PARMS, but that won't work. Does anyone have an idea?
I have to use this with MCI_SET_DOOR_OPEN / MCI_SET_DOOR_CLOSED.
Thanks for support!
Dirk
|
|
|
|