|
im drawing xp thems items with the uxtheme dll ,
i can draw buttons and listview headers.
but how do i draw listview sortbuttons?
ive tried to use the "drawthemedbackground" api and pass the constants for the sortbuttons , but it just comes out as a normal listview header image
any idea how to draw the themed listview sort arrows?
(and i want to do it propperly , not just blit my own arrows or so)
//Roger
|
|
|
|
|
I had this problem, but then found this[^] and this[^].
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
i try to search a user's all threads on the forum.
i.e. user PeterABC posted few threads, i type "PeterABC" for searching and get responding as "no such ...", but the user is definitely there!
so i guess there is the forum can't search threads, right?
thx
includeh10
|
|
|
|
|
You can click on the user's icon in the list, which takes you to the who's who part, from which you can see all postings by that user.
Steve S
|
|
|
|
|
I'm currently working on a videosurveillance software.
I have to display, as fast as possible, sequences of bitmaps, with
streching possibility.
I'm using VisualC++ 6.0, and I'm looking for someone who tried
different ways to display such images :
- drawdibdraw family functions
- strechdibits functions
- opengl texture mapping
- directx
- ... others ?
My goal is to find the FASTEST way to do it, whatever method.
Thanks
Mickey
|
|
|
|
|
directx or open-gl.
directx is faster, easier and better than open-gl.
includeh10
|
|
|
|
|
Presuming you mean 'fastest' in the context of the method that renders fastest (as opposed to the fastest method to implement), you will be looking at DirectX or OpenGL. They utilise the hardware rendering pipeline on the graphics card which essentially supplies the monitor with display information. They are ultra low-level, incredibly fast, optimised drawing interfaces mainly used in games (cos the faster the frame rate, the better). Ain't nothing gonna beat them two. DirectX is Windows (and XBox) only, whilst OpenGL is cross platform (though is unsupported on XBox cos its Microsoft!). All XBox games utilise DirectX. If your looking for the fastest to implement, then GDI's strechdibits function is quick and easy to setup, though is miles slower than DirectX or OpenGL cos it don't directly interface with the graphics hardware. Hope this helps.
|
|
|
|
|
AFAIK, SetDIBitsToDevice() is about the best you can do within GDI. Staying within GDI has many advantages (good device support, font rendering, portability, no redistributables to worry about), but if you don't need these then you may get some extra frames by going with something like OpenGL or DirectX (assuming the one you choose has good drivers for your video card).
Shog9
Let your mercy spill / On all these burning hearts in hell
If it be your will / To make us well...
|
|
|
|
|
Hi,
i want to display a bmp picture in a MFC dialog, I thought this couldn't be difficult, so i tried the following code in OnInitDialog:
HBITMAP hbm = NULL;
CStatic statBMP;
hbm = (HBITMAP)LoadImage(
NULL,
"D:\\mybmp.bmp",
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
statBMP.Create(
NULL,
WS_VISIBLE | WS_CHILD | SS_CENTERIMAGE || SS_BITMAP,
CRect(100,100,10,10),
this))
statBMP.SetBitmap(hbm);
Looks good, doesn't it ?
But this f***ing code doesn't want to work !!!! What else can i do ?
Thanks!
|
|
|
|
|
hello there,
just go the resource tab on the lft hand window .
now drag and drop the picture control on it.
then just select the properties in that select the
bitmap id so taht will be automatically displayed on the dialog box
try it and give the reply
Thanx
TAKE CARE
|
|
|
|
|
First, thank you!
... i don't know what you mean with "now drag and drop picture control on it" ?
what is picture control ? i use the german version of visual studio
Thanks
|
|
|
|
|
even if u r using the german version of VC
u will be having the toolbox when u select the resource tab and when double click the dialog box i mean when u see the dialog box then u an see the toolbox in that there is a picture control just pull or select that control and draw that on ur dialog box .
after that select the property of that control by right clicking taht picture control now what u have to do is just give the id of the Bitmaop image u want to dispaly .
this bitmap has to be in ur VC project
ok try this thiong and do reply
bye
Thanx
TAKE CARE
|
|
|
|
|
...now i got you! I know that, and it works! But that what i want to do is to load the bitmap at runtime!
thanks
|
|
|
|
|
Are hbm & statBMP members of your dialog? Cause if you declare them in OnInitDialog they are destroyed and go out of scope when OnInitDialog returns.
|
|
|
|
|
Yes, they are members of the dialog!
|
|
|
|
|
hph wrote:
WS_VISIBLE | WS_CHILD | SS_CENTERIMAGE || SS_BITMAP,
You need to change this to:
WS_VISIBLE | WS_CHILD | SS_CENTERIMAGE | SS_BITMAP, You should also have your rectangle so that the right coordinate is greater than the left coordinate and the bottom coordinate is greater than the top coordinate. If you want the static to be 10x10, use
CRect(100,100,110,110) Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I have a Problem with my OLE Server.
Problem description:
I have an OLE server which is my own application (VC++ MFC).
It will be lunched in the MS Power Point, which is my OLE container.
How can I notify my container (PowerPoint) that something was done
(changed) in the server(my App)? I was thinking about Connection
Points but I'm not sure whether this will work. Can anyone tell
me what is the solution? How can I add Connection Points to the
simple application template generated by the MFC App Wizzard
(full server option)?
Thanks in advance!!!
gicio
|
|
|
|
|
I use CDC to draw some complicate figures on screen. My problem is to draw this figure only in a defined rectangle. So is the a way to define a rectangle in which CDC draw's and outside not, as when I draw outside the screen....
|
|
|
|
|
Try to create a compatible DC in memory with the 'defined rectangle' size you want. Draw your figure in this DC and copy it to the original DC.
|
|
|
|
|
What's wrong with setting the clipping region?
Steve S
|
|
|
|
|
Hi all
Convert Integer to String!
How?
Thanks
|
|
|
|
|
itoa (), ltoa () or sprintf () functions
|
|
|
|
|
_ultoa, _ultow
or
sprintf(szBuffer, "%d", 42);
or
CString strBuffer;<br />
<br />
strBuffer.Format("%d", 42);
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Hi,
I am writing a small program that launches a third party application (a game). It extracts a few temporary, sensitive files to the hard disk, and makes sure that the user can't access them. This is the method it uses, and after trying most other avenues, I am pretty happy with it:
1) My program starts and extracts the files needed for the game to a temporary folder (and tells the system to delete these files if the system is rebooted)
2) My program then launches the game using ShellExecuteEx()
3) My program then finds the HWND handle to the game using FindWindow()
4) My program then monitors the game, checking to make sure it is the foreground window.
5) If the game (or one of its children - eg. an error box) is no longer the foreground window, my program deletes any sensitive files.
6) When the game is restored to the foreground window, my program re-extracts the necessary files. To ensure that the game doesn't try to access them before they are back on the disk, it takes these steps:
a) When the game is restored by the user, my program minimizes it again immediately.
b) My program will then show a dialog box saying "Restoring data, please wait..." with a progress bar.
c) Once the data is reloaded, my program restores the game window to the main window.
(If this sounds like an odd process, believe me that it is the best solution for what I am doing. Not necessarily the most ideal, but the best given the time I have and the little skill I have. )
So far, so good. However, because I am a relative novice, my code is far from perfect, and I am hoping someone here can show me a better way of writing the code that I am posting below, that deals with checking whether the game is in the foreground and with minimizing/restoring it accordingly. At the moment I am using a variable, int not_foreground, with GetForeGroundWindow() to check whether the game is the active window or not. However, although this works mostly, I have noticed that it doesn't work 100% of the time, which must be due to something seriously wobbly in my code (and is obviously not acceptable). Very occasionally (about 1 in 10) the game window isn't minimized by my program when the user tries to return to it, though I can't understand why. If someone could give me some pointers on how to improve this code, I would be really grateful.
Also, as I don't have access to my WinXP system for a few days and can only test this on WinMe, is there any reason the method I use for minimizing and restoring the game window wouldn't work on XP/2000 systems?
The code:
[code]
//ThirdPartyApp_hWnd = the application (game) that my program launched with ShellExecuteEx:
HWND ThirdPartyApp_hWnd = FindWindow(NULL,"Game window");
...
int not_foreground = 0;
//in main message loop:
//while the game window is active, test that it remains so:
if(not_foreground == 0)
{
if(ThirdPartyApp_hWnd != GetForegroundWindow())
{
//if the game window loses focus, make sure it's not just to a child window:
HWND checkwnd = GetForegroundWindow();
if(GetParent(checkwnd)!=ThirdPartyApp_hWnd)
{
/* My file deletion code would go here */
not_foreground = 1; //no longer foreground window
}
}
}
//while the game window is not active, check for it being restored:
if(not_foreground == 1) //not foreground
{
if(ThirdPartyApp_hWnd == GetForegroundWindow()) //game is back in foreground
{
//Minimize the program again:
SendMessage(ThirdPartyApp_hWnd,WM_SYSCOMMAND,SC_MINIMIZE,0);
/* My file restore code would go here */
Sleep(5000); //For testing purposes, just wait 5 secs
//And now restore the game as the active window:
SetWindowPos(ThirdPartyApp_hWnd,HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);
ShowWindow(ThirdPartyApp_hWnd,SW_RESTORE);
not_foreground = 0; //we are foreground again, so don't do this again
}
}
//message processing:
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if(msg.message == WM_QUIT)
{
//If user destroys the launcher, close the game too:
SendMessage(ThirdPartyApp_hWnd,WM_CLOSE,0,0);
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
[/code]
As you can see, I'm using the straight WinAPI SDK with _no_ MFC. Any suggestions for improvements or tips as to why my code might be failing on occasion would be greatly appreciated.
May thanks,
KB
|
|
|
|
|
You could try using GetAncestor with the GA_PARENT flag instead of GetParent() because it sometimes returns an owner handle instead of a parent one (which means your foreground check would be in the wrong loop). Also, since the foreground check is only ever a 1 or 0 you should use
if(not_foreground == 1)
{
//do stuff
}
else
{
//Do stuff
}
Personally I would use SetWindowsHookEx with WH_CALLWNDPROC and a CallWndProc() CALLBACK to process the messages sent to the app for the loss of keyboard focus, window activation etc. This is event driven, much more efficient than polling the foreground window every time.
|
|
|
|
|