Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Tue Mar 10, 2020 11:18 am Post subject: Animated Form or Childs |
|
|
I try to use window user32.AnimateWindow and just work fine.
Example code:
| Code: | AnimateWindowFlags =
{
AW_HOR_POSITIVE = 0x00000001,
AW_HOR_NEGATIVE = 0x00000002,
AW_VER_POSITIVE = 0x00000004,
AW_VER_NEGATIVE = 0x00000008,
AW_CENTER = 0x00000010,
AW_HIDE = 0x00010000,
AW_ACTIVATE = 0x00020000,
AW_SLIDE = 0x00040000,
AW_BLEND =0x00080000
}
function animatedObject(hwnd, time, AnimateWindowFlags)
return executeCodeLocalEx('user32.AnimateWindow', hwnd, time, AnimateWindowFlags)
end
f1 = createForm()
b1 = createButton(f1)
b1.setPosition(10,10)
b1.Caption = 'b1'
b2 = createButton(f1)
b2.setPosition(100,10)
b2.Caption = 'b2'
pnl = createPanel(f1)
pnl.Top = 50
pnl.Width = f1.Width
pnl.Height = f1.Height-50
pnl.Color = 4578200
pnl.Caption = 'This is CE Panel'
b1.OnClick = function()
animatedObject(pnl.handle, 1000, 0x00040000 | 0x00000010 | 0x00010000)
end
b2.OnClick = function()
animatedObject(pnl.handle, 1000, 0x00000002 | 0x00040000 | 0x00010000)
end |
The code above is work, but if I use keys from AnimateWindowFlags table, example:
| Code: | | animatedObject(pnl.handle, 1000, AnimateWindowFlags[AW_SLIDE] | AnimateWindowFlags[AW_CENTER] |AnimateWindowFlags[AW_HIDE]) |
I got error : attempt to perform bitwise operation on a nil value (field '?')'.
Where is the mistakes?. Is it because of Lua doesn't have enumerates type or something else?.
EDIT:
Nvm, solve it. It because wrong syntaxes:
| Code: | | animatedObject(pnl.handle, 1000, AnimateWindowFlags.AW_SLIDE | AnimateWindowFlags.AW_CENTER | AnimateWindowFlags.AW_HIDE) |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
|