In Minesweeper (XP and previous, not Vista), if you type "xyzzy" + shift+ enter then enter again you'll see a single pixel in the top left of your desktop go white or black depending on the mine status of the square you're currently mouse-overing.
Thing is, Spy++ doesn't report it to be a window.
So how in Minesweeper doing this?
-
-
Doesn't it do it on the corner of the Minesweeper window desktop?
Regardless, I would expect it to be a simple GDI call. No need to go through all the overhead of creating a window.
If I try to enable that, get a white pixel in the corner and then kill winmine.exe, I see the dot stays there until the next time that area is repainted (moving a window on top of it).
-
Yggdrasil wrote:Regardless, I would expect it to be a simple GDI call. No need to go through all the overhead of creating a window.
Ah yes, any process can paint to any window, even the desktop.
-
Every time you cheat at Minesweeper God kills a dolphin.
-
Then I'm gonna start cheating all the time. I hate dolphins. Damn uppity fish that think they're mammals! Pshaw to the lot of them!
-
darrellp wrote:Then I'm gonna start cheating all the time. I hate dolphins. Damn uppity fish that think they're mammals! Pshaw to the lot of them!
Well, HUMAN think dolphins are mammals, I doubt dolphins are able to get what "mammal" means.
Btw, aren't any creature with mammal gland (milk gland) called mammal?
-
cheong wrote:

darrellp wrote: Then I'm gonna start cheating all the time. I hate dolphins. Damn uppity fish that think they're mammals! Pshaw to the lot of them!
Well, HUMAN think dolphins are mammals, I doubt dolphins are able to get what "mammal" means.
Btw, aren't any creature with mammal gland (milk gland) called mammal?
A warm-blooded vertebrate that grows hair on its skin and (in females) produces milk for its young.
www.thetech.org/exhibits/online/robotzoo/guide/glossary.html">http://www.thetech.org/exhibits/online/robotzoo/guide/glossary.html&usg=__7Je1urv_tjcYdcwTwYa8W7czqQU=">www.thetech.org/exhibits/online/robotzoo/guide/glossary.html
PS. thanks for the minesweeper tips.
Now I just need to figure out how to play... -
darrellp wrote:Then I'm gonna start cheating all the time. I hate dolphins. Damn uppity fish that think they're mammals! Pshaw to the lot of them!
DOPHIN: I hate humans! Those stupid naked smug apes that think they are "kings of the nature!" Blood stupid kings! Bloody stupid apes! That stupid apes thinking we're saving their lives! Bloody hell! WE ARE PLAYING! Not saving their stupid worthless lives!

-
W3bbo wrote:In Minesweeper (XP and previous, not Vista), if you type "xyzzy" + shift+ enter then enter again you'll see a single pixel in the top left of your desktop go white or black depending on the mine status of the square you're currently mouse-overing.
Thing is, Spy++ doesn't report it to be a window.
So how in Minesweeper doing this?
Back on topic, I am very interested on how minesweeper can draw outside its window like this. -
DoomBringer wrote:

W3bbo wrote: In Minesweeper (XP and previous, not Vista), if you type "xyzzy" + shift+ enter then enter again you'll see a single pixel in the top left of your desktop go white or black depending on the mine status of the square you're currently mouse-overing.
Thing is, Spy++ doesn't report it to be a window.
So how in Minesweeper doing this?
Back on topic, I am very interested on how minesweeper can draw outside its window like this.
HDC desktopDC = GetDC(NULL);
SetPixel(desktopDC, 10, 10, RGB(0, 255, 0));
ReleaseDC(desktopDC);
You can draw to any window that way, provided you know its window handle (NULL is for the desktop).
EDIT: Of course, whatever you draw is erased once the window redraws itself. -
Sven Groot wrote:

DoomBringer wrote: 
W3bbo wrote: In Minesweeper (XP and previous, not Vista), if you type "xyzzy" + shift+ enter then enter again you'll see a single pixel in the top left of your desktop go white or black depending on the mine status of the square you're currently mouse-overing.
Thing is, Spy++ doesn't report it to be a window.
So how in Minesweeper doing this?
Back on topic, I am very interested on how minesweeper can draw outside its window like this.
HDC desktopDC = GetDC(NULL);
SetPixel(desktopDC, 10, 10, RGB(0, 255, 0));
ReleaseDC(desktopDC);
You can draw to any window that way, provided you know its window handle (NULL is for the desktop).
EDIT: Of course, whatever you draw is erased once the window redraws itself.
It doesn't seem to be drawing to the desktop window, though-- it seems to actually be drawing directly to the screen. Try moving your taskbar to the top-- the top left pixel will still change. -
CannotResolveSymbol wrote:
It doesn't seem to be drawing to the desktop window, though-- it seems to actually be drawing directly to the screen. Try moving your taskbar to the top-- the top left pixel will still change.
GetDC(NULL) retrieves a DC for the entire screen, if you want the Desktop then you should use GetDesktopWindow(). -
AndyC wrote:

CannotResolveSymbol wrote:
It doesn't seem to be drawing to the desktop window, though-- it seems to actually be drawing directly to the screen. Try moving your taskbar to the top-- the top left pixel will still change.
GetDC(NULL) retrieves a DC for the entire screen, if you want the Desktop then you should use GetDesktopWindow().
The Desktop includes part of the screen covered by the task bar.
If you want the part of the desktop you can see (which is to say, the desktop minus the task bar), that's called the "work area".
SPI_GETWORKAREA
-
AndyC wrote:

CannotResolveSymbol wrote:
It doesn't seem to be drawing to the desktop window, though-- it seems to actually be drawing directly to the screen. Try moving your taskbar to the top-- the top left pixel will still change.
GetDC(NULL) retrieves a DC for the entire screen, if you want the Desktop then you should use GetDesktopWindow().
Right, I always get the two mixed up.
-
AndyC wrote:

CannotResolveSymbol wrote:
It doesn't seem to be drawing to the desktop window, though-- it seems to actually be drawing directly to the screen. Try moving your taskbar to the top-- the top left pixel will still change.
GetDC(NULL) retrieves a DC for the entire screen, if you want the Desktop then you should use GetDesktopWindow().
Okeyday... I'm not a Win32 programmer, and it's such a lovely API
-
rhm wrote:Every time you cheat at Minesweeper God kills a dolphin.
Now I have a porpoise in life.... -
The common harbor porpoise has an abrupt snout, pointed teeth, and a triangular thoracic fin, while the bottle nose dolphin, or terciops truncatus, has an elongated beak; round, cone-shaped teeth, and a serrated dorsal appendage.
Man, I spent too much time watching Ace Ventura.
I also spent too much time playing Minesweeper (without cheating). Best score (on beginner): 4 seconds.
It was more due to the absolute perfect layout of mines and initial clicks that to my skill; still, I have a screencap somewhere...
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.