News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Xfire dialog

Started by dv4-masm32, November 28, 2007, 03:11:03 PM

Previous topic - Next topic

dv4-masm32

Yo,

This is my first post on the forum and I am really looking forward to learn more about masm32 cause it's a really cool programming language (I think it's the best).

One time I was with a friend who was playing a normal full screen game (nothing special) but then he pressed a certein key and there came this message window on top of his game without having to returning to the desktop (later I discovered the message program was called Xfire). I thought it was really awesome the way Xfire uses dialogs without having to return to the desktop first. So that really got my attention.

I tried to make a dialog just like in Xfire, however I totally failed. I made a little theory:
If you have a game and then get the hWnd of the process. You can then use it as a parent window to make your own dialog just like in Xfire.

My failed result:
It did make a connection to the game but it still switched back to the desktop and returning to the game was impossible until I closed the dialog.

So what exactly is the secret behind Xfire?

hutch--

The problem is reasonably simple, the dialog you tried out was a MODAL dialog which is designed to lock its calling application until its closed. What you need is a MODELESS window which can be created with the dialog engine in Windows if you wish that is set as a CHILD window of the calling app. This will mean that it runs above the app that you used to call it which is normal for a child window.

Now where you can run into problems is that Windows runs each app in its own memory space so even if you can get it to work, the code you execute within the dialog or window is not able to address the app that the handle is taken from.

Now where we cannot help you is if your task creating the dialog is used to hack or modify the original appication if you did not write it yourself. Give us some idea of what you are doing and as long as it is a legal task you have in mind we can probably help you.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dv4-masm32

Genius  :U :U :U :U :U
The dialog I used was indeed a Modal one. Too bad I have a lot of homework so I'm not gonna be able to test it soon.

Here's my idea:
Before I started using Masm32 I used another assembler (can't remember which one). There was this little chat program someone wrote as an example to demonstrate some of the internet functions using assembly. They also said that it's possible to use internet functions to link your own program to an email address and thus be able to read and send email via your own make program.

Now its not like I'm planning on making my own outlook or something but it would sure be cool to have my own program that checks if there is new email and also serves as a small chat program. If my plan works out I may actually use it and expand it with more functions such as a mp3 player or small database.

What I don't understand is if it is so easy to make a window on top of another (even in fullscreen). Then why is Xfire the only program that actually uses this technique, it shouldn't be that hard for microsoft to make something similar in a program like msn. I mean, not everyone has a supercomputer and switching back and forth between full screen mode and desktop mode can be pretty harsh on your processor.

BTW: Thanks for the quick response. :thumbu

asmftw

I'm pretty sure Xfire uses a D3D hook, that's the method I would use, but Call of Duty 4 is crashed by Xfire when you try to change graphic settings (Crappy hook?)

Tedd

It may be that XFire did nothing special, but the game you were playing at the time only made a fullscreen window - if it was using DirectX the screen would be locked, so no other windows would show.

SetForegroundWindow, along with WS_EX_TOPMOST style will bring your window in front of the other (normal) windows.
Why do other applications not do this? I think it's wise NOT to do this. Personally, I would get very annoyed with any program that tries to interrupt what I'm doing. Consider how many people you will annoy (and stop from using your program) before you design any 'feature' like this - and always allow it to be disabled.
No snowflake in an avalanche feels responsible.