Need help with win32API edit window + rgss player

Started by newold, September 05, 2014, 02:48:05 pm

Previous topic - Next topic


I am trying do a textbox with win32API with this code in rpg maker

ini ='kernel32', 'GetPrivateProfileString','PPPPLP', 'L')
@title = "\0" * 256'Game', 'Title', '', @title, 256, '.\\Game.ini')
# Getel hwnd from rgss player
@hwnd ='user32', 'FindWindowA', 'PP', 'L').call('RGSS Player', @title)

@create_window ='user32','CreateWindowEx','lpplllllllll','l')
# Build textbox
style = 0x40000000|0x02000000|0x00200000|0x0004
x, y, w, h = 100, 100, 160, 120
@script_window =, 'Edit', '', style, x, y, w,h, @hwnd, 0, 0, 0)

i want create the window edit as child of parent window (rgss player). With that code i get create de window as chlid but it appear behind of the parent window. If you put de mouse over edit window it blink, shown by an instant and sets again behind the parent window (the edit window work but it is behind the parent window).

How i get that my child window set over the parent window and dont blink or get behind again?


I think you might have to use RegisterClass or RegisterClassEx first to make this work properly.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.


I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.


Quote from: Blizzard on September 05, 2014, 03:01:04 pm
I think you might have to use RegisterClass or RegisterClassEx first to make this work properly.

i dont know what is the code to create a class window with rgss, i did this:

newClass =,:style,:lpfnWndProc,:cbClsExtra,:cbWndExtra,
 wndclass =

 wndclass.cbSize = wndclass.size = 0
 wndclass.lpfnWndProc = 0
 wndclass.cbClsExtra = 0
 wndclass.cbWndExtra = 0
 wndclass.hInstance = nil
 wndclass.hIcon = nil
 wndclass.hCursor = nil
 wndclass.hbrBackground = 5 # COLOR_WINDOW
 wndclass.lpszMenuName = nil
 wndclass.lpszClassName = "testclass"
 wndclass.hIconSm = nil

registerClass ='user32','RegisterClass','i','i')
aTom =

i dont know how send wndclass to

Quote from: ForeverZer0You can take a look at what I did here.,7829.0.html

Might help you figure out your problem.

Your window dont is child from parent window, it work but i want my window be a child from parent (if you move parent window, child window move too)