|
brigham_young wrote:
any frame windows spawned this way are always on top of the main frame window and obstruct my viewing it even when its active! (even if i set its style to WS_CLIPCHILDREN and WS_EX_TOPMOST)
WS_EX_TOPMOST should place the window above the other, you might try calling SetWindowPos() or using Create() instead of LoadFrame() .
-Nick Parker
|
|
|
|
|
Hello,
I use GDI+ with VC++.
But painting pictures speed is slow terribly.
"DashStyleSolid" is fast, but "DashStyleDot" is very slow.
It is very late besides "DashStyleSolid".
Time of big figure and a lot of figures is terrible.
Are there what or measures?
Thank you.
gata_Jzx90
|
|
|
|
|
That's just how it is, it seems. I think that on Windows 9x/ME/NT it has to create a new Windows GDI bitmap each time it draws. You can improve performance by caching the bitmap.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Thank you for an answer.
I paint pictures in Bitmap of GDI.
And I forward the Bitmap to DC with BitBlt.
However, it becomes very late by "DashStyle".
Can there be a thing that it becomes late by "DashStyle"?
Thank you.
gata_jzx90
|
|
|
|
|
Hello,
I have a binary file format that I am trying to develop a reader class for. The "word" size is always 8 bytes for double, integer or character values. I have written something like this for a file that uses 4 byte words, which is easier because an int=float=char=4 bytes.
Somehow I have to take the 8 byte word and split it into two 4 byte words and then cast? them to integers or characters.
double value
fread(value, sizeof(double), 1, m_fp);
// now get rid of the 4 bytes I dont need
// ....
Dont know if this will work or not... Any suggestions?
Ted
|
|
|
|
|
Assuming that it is little-endian:
char buf[8];
fread( buf, 8, 1, m_fp );
int nMyInt = *reinterpret_cast<int*>( buf );
If it is big-endian:
char buf[8];
fread( buf, 8, 1, m_fp );
int nMyInt = ntohl( *reinterpret_cast<int*>( &buf[4] ) );
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hey, I have a IE toolbar named KControl.dll and have just come upon a little program on Microsoft.com that will register it so that it can be used on another computer. Here is a link to the article:
http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q207132[^]
Right now the pszDllName is set to NULL. How can I make it so that it register's my DLL? I'm not quite sure what to add. Does the DLL have to be in the workspace? Any help would be greatly appreciated.
|
|
|
|
|
If you are doing this in your own code and already know the DLL's name, then you should only be interested in everyting below this line...
HINSTANCE hLib = LoadLibrary(pszDllName);
With pszDllName set to the DLL's path (including filename).
Jeremy Falcon
|
|
|
|
|
I'm still getting the same errors I got last time:
C:\WINDOWS\Desktop\Will's Folder\kazaatools\KControlInstall\Register.cpp(127) : error C2065: 'KControl' : undeclared identifier<br />
C:\WINDOWS\Desktop\Will's Folder\kazaatools\KControlInstall\Register.cpp(127) : error C2228: left of '.dll' must have class/struct/union type
I put HINSTANCE hLib = LoadLibrary(KControl.dll); (assuming they are in the same folder)
Do you know how to fix this? Thanks.
|
|
|
|
|
|
Anyone out there have a clue on resizing the non-client area of a window? I know of WM_NCCALCSIZE, but AFAIK that only controls where the client area is placed on top of the non-client area and doesn't actually change the non-client area's width.
So, say I have a window with a width of 25 for the client area and 29 for the non-client, how do I make the non-client area say 27 and keep the client area at 25? Any thoughts?
TIA,
Jeremy Falcon
|
|
|
|
|
Use SetWindowPos()
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
Use SetWindowPos()
Huh?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Thanks for the speedy reply, but I'm talking about changing the non-client area in relation to the client area, not just the window's size. SetWindowPos() only affects the non-client area of a Window.
Jeremy Falcon
|
|
|
|
|
You know, I tried to find that out myself recently, but with no luck. The AdjustWindowRect function adjusts the window's size to achieve a certain client size, but it maintains the client/outer ratio. So...
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
You may want to try using SetWindowRgn() to force the client/non-client area to appear smaller than it actually it is. This is also a standard way of drawing non-rectangular windows.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Then you couldn't have a user-resizable window, and you would have to adjust for the invisible part when resizing the window.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
You'd change the region in response to a WM_SIZE . You can fake the sizing boundary (the rectangle shown when the user resizes a window) by overriding WM_SIZING .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
And have to deal with LockWindowUpdate and drawing on the screen and erasing when you're done. All in a day's work?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Why would you need to call LockWindowUpdate() ?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Because if another app drew on the screen in an area where you had inverted an area to draw the resize border, and then you re-inverted it, you would invert a part that had just been drawn over, which would leave a strange partial inverted band on the screen until that area was re-painted. So you call LockWindowUpdate(GetDesktopWindow()) to disallow other apps from drawing on the screen. Then you call GetDC(GetDesktopWindow(),NULL,DCX_LockWindowUpdate) to draw on the desktop window yourself. When you've unlocked the window update (by calling LockWindowUpdate(NULL)), the areas which other apps have attempted to draw on will be invalidated.
PS:
It's not that this is impossible or even extremely hard - it's just that there *ought* to be a better way.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
Because if another app drew on the screen in an area where you had inverted an area to draw the resize border,
I've used regions to do what I've described with no problems. I just create a captionless window, enforce a non-standard drawing region, draw my custom caption, and handle OnHitTest() so that the user can drag the window using my custom caption bar. Windows handles painting on the desktop just fine because I've decreed what part of my window is transparent.
jdunlap wrote:
Then you call GetDC(GetDesktopWindow(),
Huh!? Are you suggesting drawing directly on the desktop and not in your window's DC?
Maybe I'm just dense and am missing your point.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I'm talking about the size border drawn when you resize, but you can do full window resize/dragging (i.e. draw the window contents rather than just the border). Windows, when drawing the size border, draws directly on the desktop.
PS: We're in danger of making this thread 3 pages long, and I don't think the original poster is even paying attention anymore!
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Thanks for the suggestion Ravi. I don't need to worry about resizing anyway because I'm dealing with menus (yeah, I'm doing my own ownerdraw ones - but without MFC). If I can get this to work, I'll give ya the credit for the tip. Either way, I'll let ya know how it pans out.
Jeremy Falcon
|
|
|
|