From: Charles Calvert Date: 2010-10-20T00:01:25+09:00 Subject: Re: How to open file dialog in Ruby, and get open FileName? :-( On Thu, 23 Sep 2010 04:58:11 -0500, iMelody Ooo wrote in <33bff42a89f93b4fe7d81cb0d212aa9d@ruby-forum.com>: >This is a pop MessaheBox example, but I don't know how to open fiel >dialog? > >shell = Win32API.new('user32','MessageBox',['L', 'P', 'P', 'L'],'I') >shell.Call(0,"hello world","ShadowZ",0) The signature of this function is: int MessageBox( HWND hWnd, // handle to owner window LPCTSTR lpText, // text in message box LPCTSTR lpCaption, // message box title UINT uType // message box style ); so your call looks correct at first glance. Note that user32.dll doesn't export a function named "MessageBox". Instead, it exports "MessageBoxA" and "MessageBoxW". The former handles ASCII strings and the latter wide strings (i.e. Unicode). When writing C or C++ code, one includes the appropriate headers that define the name "MessageBox" as one of those two using a macro. It may be that you need to call the appropriate version of the function directly if the Win32API library doesn't handle that for you. -- Charles Calvert Moderator - alt.computer.consultants.moderated Submission Address: accm@celticwolf.net Contact Address: accm_mod@celticwolf.net