|
Just a shot in the dark,
How about trapping for WM_QUERYENDSESSION windows message.
The lParam for this Message should tell you what loog off option it is.
Note that this parameter is a bit mask. To test for this value, use a bitwise operation; do not test for equality.
you need to test it with the following values
EWX_LOGOFF
EWX_POWEROFF
EWX_REBOOT
EWX_SHUTDOWN
Hope this helps
Regards
Alfadhly
<marquee>
It is Illogical to define an inventor by his invention
|
|
|
|
|
Hi all.
I need source code about 2d game programming by DX in VC++ ...
If anyone have please send to:
hadi_rezaie@hotmail.com
Thanks.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
If you want to get into this, I recommend you buy Tricks of the Windows Game Programming Gurus, by Andre Lamothe. It covers every aspect of 2D DX game programming you could think of ( I bought it to learn some AI stuff, and promptly never did, because I'm so busy ).
The SDK also has some game examples, including one called Donuts, an Asteroids game ( I've never seen it because I wrote my own and didn't want to see their source code unless I became absolutely stuck, on the basis that originally I stole their graphics I presume it would be a good exmaple though, but I'm sure it does not use MFC, if you're not used to Win32 style programs. Of course, that would make another reason why you'd benefit from checking it out....
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
Can i learn DirectX programming by this book ?
Because i want to learn DX7 programming, what is best book for it ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Direct X is up to 8a, why did you choose 7 ? The trouble is they update it so often that there *are* no good books on the latest versions, they are too new. The book I mentioned will cover enough to get you going, but in DX5 ( from memory ). The fundamentals are the same though, especially in 2D. The book gets my vote for broad ( if not terribly deep ) coverage of everything from DirectDraw ( which is what you want )to DirectSound to AI to physics modelling. It's a good overview, and will probably serve you very well in terms of getting you to the point of being able to write a 2D game.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
I choose DX7 for graphic programming ...
And i don't want to say, why i choose DX7 ?!!!
In your book, Andre Lamonthe used about DX5 ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Fair enough - no need to take it personally. I didn't ask your sexual preference
Like I said, ultimately for DirectDraw it doesn't really matter *that* much, the changes are more in Direct3D ( especially from 7 to 8, but that is another story ). Yes, the book uses 5. So do the official Microsoft books on the subject. Like I said, the hectic release schedule of DirectX versions means by the time books come out, two versions of DX have ticked by.... It is generally accepted that there are no *really* good Direct3D books, people get the general theory from the Red book and then find out the D3D commands from the MSDN.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
hmmm, Yes.
You said: DirectDraw programming have not different in DX7 or DX8 or DX5, but D3D have many different in DX5 and DX7 and ...
SO, IF I BUY THIS BOOK, I LEARN PROGRAMMING BY DirectDraw in DX ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
>> hmmm, Yes.
>>You said: DirectDraw programming have not different in DX7 or DX8 or DX5, but D3D have many different in DX5 and DX7 >>and ...
>>SO, IF I BUY THIS BOOK, I LEARN PROGRAMMING BY DirectDraw in DX ???
I'm confused here. I'm not sure what the emphasis on the last sentence means. Yes, the book I recommended deals with all facets of writing a 2D game using DirectX, which, by definition, means DirectDraw. I am told there are some pretty cool new DD things in DX8, such as being able to play a movie direct onto a surface, but I would still suspect that there would be more new stuff on the 3D side than in Direct Draw, and certainly DX5 up has everything in Direct Draw that I'd image you *needing*. The book includes full source for a DD game ( an Asteroids game ), which gets built through the book. You should probably go to FatBrain or Amazon if you're interested in the book, and read what other people think of it, plus see an outline of what is in the book. The MicroSoft DirectX book covers DD ( and everything else bar D3D ) and is also a useful reference, but if you specifically want to write a game, then the book I recommended will cover all the other areas you'll want to know about as well. Like I said, the SDK also contains full source to a DD game, that may be all you need.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I have a new project that's taking me into some areas of Windows that I haven't previously looked at.
Here's the problem. I am postprocessing a video stream (1000 frames per second, 128 x 128 pixel by 12 bit grayscale). This is stored to disk as a raw array of unsigned shorts. I want to have a window in the GUI that plays the video in real-time (i.e., it will drop lots of frames but keep pretty much synchronized with the original speed) with the option of slowing it down or clicking through frame-by-frame. While all this is going on, I would also like the viewer to be able to click the mouse on an individual pixel and see an intensity-versus-time graph of that pixel in another window.
MS offers a huge wealth of media APIs: plain GDI BitBlt'ing, DirectDraw, DirectShow, Windows Media (IAVIStream, etc.). I am not clear on the comparative advantages of each and which is best suited for my task. Memory is cheap, but the raw data amounts to about 2 gigabytes per minute, so I can't keep everything in memory. I can also afford to do time-intensive preprocessing (such as processing the raw data into a special format for efficient display) if it will speed up the user's runtime experience, but I can't accept MPEG-style artifacts when the user freeze-frames. All things being equal, I would like to get this simple video GUI up and running simply and quickly so that I can get to the hard part of the project---analysis of the images.
I anticipate that I will have to forgo some of the requirements I list above, but I'd like to learn more about what the constraints and trade offs are (comprehensive features vs. runtime speed vs. development difficulty).
Does anyone who's been there/done that want to give me some advice?
He was allying himself to science, for what was science but the absence of prejudice backed by the presence of money? --- Henry James, The Golden Bowl
|
|
|
|
|
i would pre-build a play stream of frame numbers that basically indexed into the actual frames then you could allow the user to select which 'stream' they wanted to play back, ie, start from frame 1 or frame 2 or frame 3 etc and show every (say) 50th frame ... using directx would prolly give you better playback although the frames are quite small
a simple compression that might work (given the small-ish number of gray shades) is a simple changed pixels only scheme like mpg but without the lossy transformations they apply but this depends on the nature of the data
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I have a WTL project based on the ClistViewCtrl class. I’m trying to left mouse button down to select an item in the list. The NM_CLICK is supposed to respond to LmouseDown, but doesn’t..The MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown) does but the call GetSelectedIndex() (in ..\atlctrls.h) returns xFFFFFFFF. Not what I expect. Any suggestions ? Also what should I cast the lparam to in the message handler?
|
|
|
|
|
Hey,
I'll assume you tring to handle all the message you mentioned in your list-view control.
First to get the NM_CLICK notification to work (as well as any other notification) you need to reflect the notifications back from the mainframe (this is a standard procedure, thought MFC does a nice job of hidding it from us). To do this use the REFLECT_NOTIFICATIONS () macro in you mainframe's message map (or what ever window is the list-view's parent). Also, when you handle the message use REFLECTED_NOTIFY_CODE_HANDLER in you list-view message map.
Second the reason I think your getting a wrong result from GetSelectedIndex () in your WM_LBUTTONDOWN message handler is because you are probably not letting Windows do its default processing (selecting the item), simply make call to DefWindowProc () before you try and get the selected item's index -- also note that this function only works with single selection list-views.
> Also what should I cast the lparam to in the message handler?
no need to cast, just use:
CPoint point ( GET_X_LPARAM ( lParam ), GET_Y_LPARAM ( lParam ) );
Hope this helps.
-Ben
"Its funny when you stop doing things not because they’re wrong, but because you might get caught." - Unknown
|
|
|
|
|
Here's something that has always bugged me -
Say we have a context menu that pops up when an item in a tree or list view is right-clicked. The command for that item is sent.. somewhere, say to the main window. How can I associate that command with the item that spawned it? There's no room in the command message for any kind of handle to the item, item ID, or anything like that.
I've done this before on smaller apps, and have used various kludges (space the commands properly and add an item ID to the command number, etc.) but I'm never happy with the solutions I come up with. Does anyone have a suggestion?
|
|
|
|
|
In my code, the command message handlers just retrieve the selected item in the control. Simple, eh?
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Umm guess that was a stupid question, wasn't it . Of course that works. In my own defencse, I was thinging back on another, similar project, where I had something much more complicated to do. the weight of my esperience is starting to slow me down .
Thanks for the help -
|
|
|
|
|
Umm guess that was a stupid question, wasn't it
No no no, it was an easy question. Big difference.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
When you minimize an application, a huge amount of memory is decommited back to the system (You can check this with the Windows Taskmanager)... Does anyone know how to force this inside the application, without minimizing the mainwindow ?
|
|
|
|
|
_heapmin() can do this to a degree. As far as I know it is the only way to release memory back to the OS in Win32.
|
|
|
|
|
SetProcessWorkingSetSize. Available on NT/2K only.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thank you very much, the both of you for making time... You soulved a huge problem I was struggling with... Thankx
|
|
|
|
|
Is there a standard method for opening a file with it's default/associated file opener?
One has, for instance, the path to "C:\mytxt.doc" and wants to use the user-defined viewer (usually Word) to open this without having to check the configurated association tables
Thanx.
Per Pusling
|
|
|
|
|
Check ShellExecute and ShellExecuteEx.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Yep, ShellExecute() does just this. Pass your document filename, and a verb of "open" and the API will launch the associated program.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Hello everyone,
I'm trying to do a file search from my application, So I was wondering if there is a way to employ windows File Search (Start -> Find -> File or Folder) functionality through any kind of APIs
Thanks in advance for your help.
Fady
|
|
|
|