mIRC Home    About    Download    Register    News    Help

Print Thread
@window hi-jinks for a custom purpose: overlay #237165 16/04/12 03:20 AM
Joined: Apr 2012
Posts: 6
S
Shadowblight Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2012
Posts: 6
Hey so the scenario I'm working with is that I'm trying to create an IRC window which will allow me to make its background transparent, always on top and basically therefore allow me to set it as an overlay in a fullscreen-windowed game.

This... sounds like it shouldn't be such a project in the age of Xfire and Steam etc, but apparently it is. I've done extensive Googling to no avail, so here I am trying to put something together that will work myself.

First off, I can get a new window pretty easily by using the following command:

Code:
/window -dofB +d @EveryThing 0 0 [800 600]


(BTW is there a way to rid myself of the scroll bar? That would be ideal since I don't plan on actually scrolling right in the middle of the game, but more rather just want a few lines available...)

But now my difficulty comes in that I can't get the text from channels to display in that window. I was using the code from the tail end of this page to get it to print in that window (dropped right into the Remote section):

Code:
ON *:TEXT:*:#: {
  window @EveryThing
  aline @EveryThing $chr(3) $+ 5[ $+ $chr(3) $+ 2 $+ $chan $+ $chr(3) $+ 5] $chr(3) $+ 5< $+ $chr(3) $+ 10 $+ $nick($chan,$nick).pnick $+ $chr(3) $+ 5> $+ $chr(3) $+ 1 $1-
  window -g1 @EveryThing
}
Menu @EveryThing {
  Close Window: { window -c $active }
}


However, the only part that seems to be working properly out of this is the right-click to close window menu option. Which is nice, I guess. But I'd really rather get this to show what's being said in my channels, and it won't. I've tried changing 'aline' to 'echo' with no change, either.

Can anyone help?

Re: @window hi-jinks for a custom purpose: overlay [Re: Shadowblight] #237166 16/04/12 06:56 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Alas, the world of Xfire and steam are a very different world from the rest of your software applications. I'm afraid you're probably not going to get very far without resorting to some kind of a dll.

Full screen games are a very specific thing. You might imagine that they would just be "on top" windows in the window hierarchy, which means you could just add another window "on top" of that game, and voila-- but this is not actually how these windows work. Full screen applications are special-- they are not part of the window hierarchy. In fact, the window hierarchy is completely disabled for the monitor when an application goes full screen, and Windows will give the application exclusive access to read/write directly to the monitor buffer as an optimization. So the full screen app isn't some borderless window that spans the full width/height of your monitor-- it literally *is* the entire monitor.

In other words, a full screen application is completely bypassing the Windows graphics layer when it renders data. This means that your GDI window isn't going to render, let alone be on top of the full screen game. The game has full draw access to the screen, and I'm afraid this means that Windows is not going to render any GDI data on that screen. In order to draw on that screen, you would have to do exactly what the game is doing, and draw directly to the monitor buffer-- but even then, the full screen app is likely to overwrite your data, so you will have to continually redraw your data every frame.

Steam and XFire solve this problem by writing very specific (and somewhat hacky) code for full screen applications. They are basically hooking directly into the DirectX/OpenGL drawing functions, catching calls to "DrawXXXX" and adding in their own overlays afterwards. You can read more about the process on this StackOverflow page, which describes the method nicely. Like I said, it's messy, and even though you might think we're in the "age of Steam", this still isn't really a solved problem, technologically speaking. Programmers are still resorting to neanderthal tactics to hack these overlays into full screen apps, and it's not a trivial task.

So in short, I hate to say "give up", but unfortunately using mIRC script just won't cut it. If you know C/C++, take a look at the SO article and you might have better luck doing this natively. You definitely won't be able to use GDI as an overlay, though. You'll have to draw the entire overlay window manually.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: @window hi-jinks for a custom purpose: overlay [Re: argv0] #237169 16/04/12 12:29 PM
Joined: Apr 2012
Posts: 6
S
Shadowblight Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2012
Posts: 6
Ah I'm already aware this is not possible in true fullscreen, however I am in what is called a fullscreen-windowed mode. It is basically making the system look fullscreen while in windowed mode, at the cost of resources. I can get the IRC window on top with no trouble this way. But I am still looking for why it won't print things in the window I've made... apparently I need help with the scripting and then I'll work to make it transparent. ;3

Re: @window hi-jinks for a custom purpose: overlay [Re: Shadowblight] #237190 16/04/12 05:04 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
The code you posted works for me. Make sure you have no other on text events in the same file. You can use /echo instead of aline, as /echo will log (if window logging is enabled), whereas /aline bypasses logging. Nice to have if you ever want to enable logging for that window. Other than that it should work.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: @window hi-jinks for a custom purpose: overlay [Re: argv0] #237194 16/04/12 07:31 PM
Joined: Apr 2012
Posts: 6
S
Shadowblight Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2012
Posts: 6
Thank you for all your help.

In the interest of making sure I'm working with a completely clean slate, I uninstalled mIRC and nuked the directory under both the Program Files (x86) folder, and also the C:/Users/<username>/AppData/Roaming/ directory for mIRC.

Afterwards I reinstalled the program.

Everything is completely blank in the ctrl-R ("Remote") section except what is pasted above for ON text, and then I have manually typed in the command for the window in the input box to get it to come up. I'm at a loss, because it still refuses to show what's being typed in channels in the EveryThing window. frown

[edit] Unless it's not meant to catch things I type myself...?

Last edited by Shadowblight; 16/04/12 07:46 PM.
Re: @window hi-jinks for a custom purpose: overlay [Re: Shadowblight] #237195 16/04/12 09:15 PM
Joined: Oct 2009
Posts: 24
Scakk Offline
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2009
Posts: 24
The event "on text" is for everyone else. The event "on input" is for your own entered text.

I noticed you are not tracking people that use actions. ( on action ).


Last edited by Scakk; 16/04/12 09:15 PM.
Re: @window hi-jinks for a custom purpose: overlay [Re: Scakk] #237197 17/04/12 01:09 AM
Joined: Apr 2012
Posts: 6
S
Shadowblight Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2012
Posts: 6
Ah okay, so yeah it is working for others. I had to go into another person's channel to test it.

And yeah, I'd like to catch actions perhaps, but I don't know how I'd incorporate that... as you can see I was pulling that code from that page wholesale, so I'm not really sure what does what. frown

Also, I was trying to set up transparency, and I thought mIRC had a function that did that, something like setlayer? But I'm not sure where to put that, because trying to do it after the EveryThing window is opened doesn't display.

I was also looking at picture window as a possibility since it wouldn't have a scrollbar which would be completely perfect, but I couldn't find a command that might drawtext from the channels into it.

I hate when finding the answer to one question only leads to more. >_<

Re: @window hi-jinks for a custom purpose: overlay [Re: Shadowblight] #237199 17/04/12 06:11 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Why not just run your channel as an on top desktop window in itself? Then you don't need to script anything.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: @window hi-jinks for a custom purpose: overlay [Re: argv0] #237207 17/04/12 01:23 PM
Joined: Apr 2012
Posts: 6
S
Shadowblight Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2012
Posts: 6
I was looking for something more visually appealing and less clunky than just a large window with unnecessary title bars/scroll bars/menu bars. I can clearly use just regular programs like Glass2k or PowerMenu to force things on top of the game with transparency without scripting, but I find that this won't allow me to keep the window size small- and out-of-the-way-enough for my tastes. (I feel like I would run into the window instead of interacting with the game too much~)

I only have a 20" 1680x1050, which I understand isn't the industry norm out there of larger screens, so I have to deal with what I own. frown

Re: @window hi-jinks for a custom purpose: overlay [Re: Shadowblight] #237217 18/04/12 03:58 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
mIRC channel windows would be as small as any custom window you could make. As I said, you would show the channel window only, not the entire mIRC application. Just set the window on the desktop by clicking on the channel icon at the top left (not mIRC's icon) and click "Desktop". Voila. You can also hide the nicklist in the same fashion. No scripting necessary.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: @window hi-jinks for a custom purpose: overlay [Re: argv0] #237226 18/04/12 07:21 PM
Joined: Apr 2012
Posts: 6
S
Shadowblight Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2012
Posts: 6
Okay, but do you by chance also have any thoughts on the transparency issue? /setlayer still doesn't seem to affect this...