AutoHotkey Community

It is currently May 27th, 2012, 11:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: April 29th, 2010, 12:48 am 
Offline

Joined: May 3rd, 2009, 6:37 pm
Posts: 67
I have assigned and remapped the scroll lock to do something different but at the same time I want the scroll lock state( the flashing lights) to work. I can't get them to work. Why is this? is there any workaround?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2010, 1:48 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
write a test script that allows you to change the "ScrollLockState" without your original script assigning or remapping.

[tested]
Code:
f3::SetScrollLockState, on
f4::SetScrollLockState, off


If that script doesn't work, fix it.
If the script works, find out what the difference is between it and your 'problem' script


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2010, 2:01 am 
Offline

Joined: May 3rd, 2009, 6:37 pm
Posts: 67
I already tested it individually and it worked. Now the problem happens when assigning scrollock a function to do something.
Ex. In this case I want to lock/unlock the active window by pressing scroll lock on the keyboard. I also want the light to stay on whenever any windows are locked and off whenever they are not. this is my somewhat incomplete code.
Code:
SetScrollLockState, off
DisableCloseButton(hWnd="") {
 If hWnd=
    hWnd:=WinExist("A")
 hSysMenu:=DllCall("GetSystemMenu","Int",hWnd,"Int",FALSE)
 nCnt:=DllCall("GetMenuItemCount","Int",hSysMenu)
 DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-1,"Uint","0x400")
 DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-2,"Uint","0x400")
 DllCall("DrawMenuBar","Int",hWnd)
Return ""
}
RedrawSysMenu(hWnd="") {
 If hWnd=
    hWnd:=WinExist("A")
 DllCall("GetSystemMenu","Int",hWnd,"Int",TRUE)
 DllCall("DrawMenuBar","Int",hWnd)
Return ""
}


ScrollLock::DisableCloseButton(WinExist("A"))



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2010, 2:03 am 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Use a global variable to count the number of windows locked.
Increase/decrease it as necessary.
Use the SetTimer command to check this variable and execute SetScrollLockState accordingly.

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bowen666, MSN [Bot], Yahoo [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group