Need help with win32API edit window + rgss player

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

Previous topic - Next topic

newold

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

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

@create_window = Win32API.new('user32','CreateWindowEx','lpplllllllll','l')
# Build textbox
#style = WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|ES_MULTILINE
style = 0x40000000|0x02000000|0x00200000|0x0004
x, y, w, h = 100, 100, 160, 120
@script_window = @create_window.call(0, '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?

Blizzard

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.

ForeverZer0

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.

newold

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 = Struct.new(:cbSize,:style,:lpfnWndProc,:cbClsExtra,:cbWndExtra,
   :hInstance,:hIcon,:hCursor,:hbrBackground,:lpszMenuName,:lpszClassName,
   :hIconSm)
   
 wndclass = newClass.new

 wndclass.cbSize = wndclass.size
 wndclass.style = 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 = Win32API.new('user32','RegisterClass','i','i')
aTom = registerClass.call(??????????)


i dont know how send wndclass to registerClass.call()




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

http://forum.chaos-project.com/index.php/topic,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)