mIRC Home    About    Download    Register    News    Help

Print Thread
Custom desktop @windows steal focus #206694 21/11/08 04:23 AM
Joined: Oct 2005
Posts: 28
T
TheArkive Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Oct 2005
Posts: 28
I saw this topic already listed as "Custom window problem". I posted to it but no one answered. I'm hoping to get some feedback.

I'm using this:

/window -dfhop +dL

here is the alias and the usage:
USAGE: /buddy_logon [text1] [text2]
(generally [text1] = nick .... [text2] = network)

Code:

alias buddy_logon {
  .timerbud_note_* off
  .timer_logon_close off
  if ( $window(@Logon) ) window -c @Logon

  var %bground $gettok($(%menu_settings),4,32)
  var %Fcolor $gettok($(%menu_settings),3,32)
  var %Fname $gettok($(%menu_settings),1,32)
  var %Fsize $gettok($(%menu_settings),2,32)
  var %phrase Logon: $1 on $2
  var %width $width($(%phrase),$(%Fname),$(%Fsize),0,0)
  var %height $height($(%phrase),$(%Fname),$(%Fsize))

  var %width2 $calc( %width + 20 )
  var %height2 $calc( %height + 60 )

  var %y $calc( %height2 * -1 )

  window -dfhop +dL @Logon 0 0 %width2 %height2
  window @Logon 0 %y
  window -a @Logon
  drawrect -f @Logon %Fcolor 0 0 0 %width2 %height2
  drawtext @Logon %bground %Fname %Fsize 10 30 %phrase

  bud_note_enter @Logon %height2
  .timer_logon_close 1 5 bud_note_exit @Logon %height2
}



Here is the part giving me trouble:

window -dfhop +dL @Logon 0 0 %width2 %height2
window @Logon 0 %y
window -a @Logon


The function of this window is to be a notification window when someone logs on. It is similar to the MSN Messenger notification, but it happens in the top left corner.

I'm trying to do this WITHOUT the focus being taken. Sometimes I'll be typing in another app when the window comes up, and my typing will be interrupted. Also, one slight annoyance is that I can't open the window with a negative y value (so that it opens off the screen, then my timers kick in and move the window down... a simple sliding animation).

Currently I have to open the window hidden at x=0 y=0, and then change y to y=(%height2 * -1)

Opening with -h means i have to use -a to see it again! And i know that -a WILL steal the focus. I double-checked the focus problem by not using -h, then -a, but still the same problem, as was stated before, it is a desktop window.

Is it possible to request this as a feature?

ie. not steal focus, and can open window with negative values for off-screen opening? ... also being able to hide and view the window without stealing focus?

Or is there something about how mIRC handles windows to prevent that kind of functionality?

Re: Custom desktop @windows steal focus [Re: TheArkive] #206695 21/11/08 06:04 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quote:
Is it possible to request this as a feature?

ie. not steal focus, and can open window with negative values for off-screen opening? ... also being able to hide and view the window without stealing focus?
The simple answer is Yes. You do so through the Feature Suggestions section of this forum.

As no one replied to your earlier post, it's likely that those who tried various options to try to do what you're requesting within the current restrictions of mIRC coding, were unable to do so, and rather than post a whole bunch of things like "Sorry I can't do this" they decided to just not post at all.

Re: Custom desktop @windows steal focus [Re: TheArkive] #206697 21/11/08 11:41 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Have you checked out the $tip() identifier? It is designed exactly for this stuff, although the notifications always slide up from the bottom right corner.

If this intended for notifications when users in your notify list log on, you don't even have to script it - mirc has this built-in.

Type /help tips for more information.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Custom desktop @windows steal focus [Re: qwerty] #206703 21/11/08 08:36 PM
Joined: Oct 2005
Posts: 28
T
TheArkive Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Oct 2005
Posts: 28
Thanks for your responses guys.

qwerty, that is particularly helpful. Much appreciated! Though I wish it could be set even if mIRC was active, this is still a very viable option for me.

Once again, thank you.