Detect if bitmap bits are locked

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Stealthle
Posts: 32
Joined: 13 Mar 2017, 00:48

Detect if bitmap bits are locked

Post by Stealthle » 13 Apr 2023, 10:29

I have a script that edits bitmaps and uses lockbits,numget and numput for speed reasons. The script has to unlock the bits afterwards to use other GDIP functions like Drawimage and clonebitmap from Tic's library. The script also has a timer that uses numget on the same bitmap for a magnifying tool to allow to see zoomed in while editing.

The problem is sometimes the timer tries to use numget when the main script has unlocked the bits causing a read/write error. So I'm looking for a way the timer can check first to see if the bits are locked before attempting to use Numget preferably without setting a bunch of flags because it congests the script and has the rare chance the timer may go off between calling lockbits and setting the flag. I can't make the timer unconditionally lock the bits be because when it returns it will fail on Drawimage so it needs to only do it if it's locked

Any help is much appreciated!

Return to “Ask for Help (v1)”