Skip to content

Commit

Permalink
Gui::Menu module initiated, GetMenu function added
Browse files Browse the repository at this point in the history
  • Loading branch information
arvicco committed Jun 18, 2010
1 parent a6175d4 commit 0218233
Show file tree
Hide file tree
Showing 14 changed files with 339 additions and 251 deletions.
4 changes: 4 additions & 0 deletions HISTORY
Expand Up @@ -62,3 +62,7 @@
== 0.3.17 / 2010-06-13

* Message fucntions now accept both Pointer and Long lParams

== 0.3.18 / 2010-06-18

* Gui::Menu module initiated
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.3.17
0.3.18
266 changes: 133 additions & 133 deletions lib/win/dde.rb

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions lib/win/error.rb
Expand Up @@ -882,7 +882,7 @@ module Error
# to an array of values that represent the arguments. This flag cannot be used with 64-bit integer
# values. If you are using a 64-bit integer, you must use the va_list structure.
# - FORMAT_MESSAGE_FROM_HMODULE - The lpSource parameter is a module handle containing the message-table
# resource(s) to search. If this lpSource handle is NULL, the current process's application image file
# resource(s) to search. If this lpSource handle is NULL, the current process's App image file
# will be searched. This flag cannot be used with FORMAT_MESSAGE_FROM_STRING. If the module has no
# message table resource, the function fails with ERROR_RESOURCE_TYPE_NOT_FOUND.
# - FORMAT_MESSAGE_FROM_STRING - The lpSource parameter is a pointer to a null-terminated string that
Expand All @@ -892,7 +892,7 @@ module Error
# - FORMAT_MESSAGE_FROM_SYSTEM - The function should search the system message-table resource(s) for
# the requested message. If this flag is specified with FORMAT_MESSAGE_FROM_HMODULE, the function
# searches the system message table if the message is not found in the module specified by lpSource.
# This flag cannot be used with FORMAT_MESSAGE_FROM_STRING. If this flag is specified, an application
# This flag cannot be used with FORMAT_MESSAGE_FROM_STRING. If this flag is specified, an App
# can pass the result of the GetLastError function to retrieve the message text for a system error.
# - FORMAT_MESSAGE_IGNORE_INSERTS - Insert sequences in the message definition are to be ignored and
# passed through to the output buffer unchanged. This flag is useful for fetching a message for later
Expand Down Expand Up @@ -1027,7 +1027,7 @@ module Error
# GetLastError Function
# Retrieves the calling thread's last-error code value. The last-error code is maintained on a
# per-thread basis. Multiple threads do not overwrite each other's last-error code.
# Visual Basic: Applications should call err.LastDllError instead of GetLastError.
# Visual Basic: Apps should call err.LastDllError instead of GetLastError.
#
# [*Syntax*] DWORD WINAPI GetLastError( void );
#
Expand All @@ -1053,9 +1053,9 @@ module Error
# that can be returned by each function. There are also many functions whose documentation does not
# include even a partial list of error codes that can be returned.
# Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for
# application-defined error codes; no system error code has this bit set. If you are defining an error
# code for your application, set this bit to one. That indicates that the error code has been defined by
# an application, and ensures that your error code does not conflict with any error codes defined by the
# App-defined error codes; no system error code has this bit set. If you are defining an error
# code for your App, set this bit to one. That indicates that the error code has been defined by
# an App, and ensures that your error code does not conflict with any error codes defined by the
# system.
# To convert a system error into an HRESULT value, use the HRESULT_FROM_WIN32 macro.
# ---
Expand Down Expand Up @@ -1083,16 +1083,16 @@ module Error
# - The last-error code is kept in thread local storage so that multiple threads do not overwrite each
# other's values.
# - This function is intended primarily for use by dynamic-link libraries (DLL). A DLL can provide the
# applications that are using it with additional diagnostic information by calling this function after
# Apps that are using it with additional diagnostic information by calling this function after
# an error occurs. Most functions call SetLastError or SetLastErrorEx only when they fail. However, some
# system functions call SetLastError or SetLastErrorEx under conditions of success; those cases are
# noted in each function's documentation.
# - Applications can optionally retrieve the value set by this function by using the GetLastError function
# - Apps can optionally retrieve the value set by this function by using the GetLastError function
# immediately after a function fails.
# - Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for
# application-defined error codes; no system error code has this bit set. If you are defining an error
# code for your application, set this bit to indicate that the error code has been defined by your
# application and to ensure that your error code does not conflict with any system-defined error codes.
# App-defined error codes; no system error code has this bit set. If you are defining an error
# code for your App, set this bit to indicate that the error code has been defined by your
# App and to ensure that your error code does not conflict with any system-defined error codes.
# ---
# <b>Enhanced (snake_case) API: </b>
#
Expand All @@ -1116,16 +1116,16 @@ module Error
# The last-error code is kept in thread local storage so that multiple threads do not overwrite each
# other's values.
# This function is intended primarily for use by dynamic-link libraries (DLL). A DLL can provide the
# applications that are using it with additional diagnostic information by calling this function after
# Apps that are using it with additional diagnostic information by calling this function after
# an error occurs. Most functions call SetLastError or SetLastErrorEx only when they fail. However, some
# system functions call SetLastError or SetLastErrorEx under conditions of success; those cases are
# noted in each function's documentation.
# Applications can optionally retrieve the value set by this function by using the GetLastError function
# Apps can optionally retrieve the value set by this function by using the GetLastError function
# immediately after a function fails.
# Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for
# application-defined error codes; no system error code has this bit set. If you are defining an error
# code for your application, set this bit to indicate that the error code has been defined by the
# application and to ensure that your error code does not conflict with any system-defined error codes.
# App-defined error codes; no system error code has this bit set. If you are defining an error
# code for your App, set this bit to indicate that the error code has been defined by the
# App and to ensure that your error code does not conflict with any system-defined error codes.
#
# :call-seq:
# set_last_error_ex(err_code, dw_type)
Expand All @@ -1145,19 +1145,19 @@ module Error
# SEM_FAILCRITICALERRORS:: The system does not display the critical-error-handler message box. Instead,
# the system sends the error to the calling process.
# SEM_NOALIGNMENTFAULTEXCEPT:: The system automatically fixes memory alignment faults and makes them
# invisible to the application. It does this for the calling process and
# invisible to the App. It does this for the calling process and
# any descendant processes. This feature is only supported by certain
# processor architectures. For more information, see the Remarks section.
# After this value is set for a process, subsequent attempts to clear the
# value are ignored.
# SEM_NOGPFAULTERRORBOX:: The system does not display the general-protection-fault message box. This
# flag should only be set by debugging applications that handle general
# flag should only be set by debugging Apps that handle general
# protection (GP) faults themselves with an exception handler.
# SEM_NOOPENFILEERRORBOX:: The system does not display a message box when it fails to find a file.
# Instead, the error is returned to the calling process.
# ---
# *Remarks*:
# Each process has an associated error mode that indicates to the system how the application is going to
# Each process has an associated error mode that indicates to the system how the App is going to
# respond to serious errors. A child process inherits the error mode of its parent process.
# To change the error mode for the process, use the SetErrorMode function.
# ------
Expand All @@ -1180,26 +1180,26 @@ module Error
# SEM_FAILCRITICALERRORS:: The system does not display the critical-error-handler message box. Instead,
# the system sends the error to the calling process.
# SEM_NOALIGNMENTFAULTEXCEPT:: The system automatically fixes memory alignment faults and makes them
# invisible to the application. It does this for the calling process and any
# invisible to the App. It does this for the calling process and any
# descendant processes. This feature is only supported by certain processor
# architectures. For more information, see the Remarks section.
# After this value is set for a process, subsequent attempts to clear the
# value are ignored.
# SEM_NOGPFAULTERRORBOX:: The system does not display the general-protection-fault message box. This flag
# should only be set by debugging applications that handle general protection (GP)
# should only be set by debugging Apps that handle general protection (GP)
# faults themselves with an exception handler.
# SEM_NOOPENFILEERRORBOX:: The system does not display a message box when it fails to find a file. Instead,
# the error is returned to the calling process.
#
# *Returns*:: The return value is the previous state of the error-mode bit flags.
# ---
# *Remarks*:
# Each process has an associated error mode that indicates to the system how the application is going to
# Each process has an associated error mode that indicates to the system how the App is going to
# respond to serious errors. A child process inherits the error mode of its parent process. To retrieve
# the process error mode, use the GetErrorMode function.
# Because the error mode is set for the entire process, you must ensure that multi-threaded applications
# Because the error mode is set for the entire process, you must ensure that multi-threaded Apps
# do not set different error-mode flags. Doing so can lead to inconsistent error handling.
# The system does not make alignment faults visible to an application on all processor architectures.
# The system does not make alignment faults visible to an App on all processor architectures.
# Therefore, specifying SEM_NOALIGNMENTFAULTEXCEPT is not an error on such architectures, but the system
# is free to silently ignore the request. This means that code sequences such as the following are not
# always valid on x86 computers:
Expand All @@ -1208,9 +1208,9 @@ module Error
# fuOldErrorMode = SetErrorMode(0);
# ASSERT(fuOldErrorMode == SEM_NOALIGNMENTFAULTEXCEPT);
#
# Itanium:: An application must explicitly call SetErrorMode with SEM_NOALIGNMENTFAULTEXCEPT to have the
# Itanium:: An App must explicitly call SetErrorMode with SEM_NOALIGNMENTFAULTEXCEPT to have the
# system automatically fix alignment faults. The default setting is for the system to make alignment
# faults visible to an application.
# faults visible to an App.
# Visual Studio 2005:: When declaring a pointer to a structure that may not have aligned data, you can use
# __unaligned keyword to indicate that the type must be read one byte at a time. For more
# information, see Windows Data Alignment.
Expand Down
2 changes: 2 additions & 0 deletions lib/win/gui.rb
Expand Up @@ -2,6 +2,7 @@
require 'win/gui/input'
require 'win/gui/message'
require 'win/gui/dialog'
require 'win/gui/menu'

module Win

Expand All @@ -12,5 +13,6 @@ module Gui
include Win::Gui::Input
include Win::Gui::Message
include Win::Gui::Dialog
include Win::Gui::Menu
end
end
12 changes: 6 additions & 6 deletions lib/win/gui/dialog.rb
Expand Up @@ -71,7 +71,7 @@ module Dialog

# The user must respond to the message box before continuing work in the window identified by the hWnd
# parameter. However, the user can move to the windows of other threads and work in those windows.
# Depending on the hierarchy of windows in the application, the user may be able to move to other
# Depending on the hierarchy of windows in the App, the user may be able to move to other
# windows within the thread. All child windows of the parent of the message box are automatically
# disabled, but pop-up windows are not.
# MB_APPLMODAL is the default if neither MB_SYSTEMMODAL nor MB_TASKMODAL is specified.
Expand All @@ -82,7 +82,7 @@ module Dialog
# windows other than those associated with hWnd.
MB_SYSTEMMODAL = 0x00001000
# Same as MB_APPLMODAL except that all the top-level windows belonging to the current thread are
# disabled if the hWnd parameter is NULL. Use this flag when the calling application or library does not
# disabled if the hWnd parameter is NULL. Use this flag when the calling App or library does not
# have a window handle available but still needs to prevent input to other windows in the calling thread
# without suspending other threads.
MB_TASKMODAL = 0x00002000
Expand Down Expand Up @@ -145,10 +145,10 @@ module Dialog
ErrorIcon = 0x14 # ID of Error Icon (this dialog informs about some Error)

##
# DialogProc is an application-defined callback function used with the CreateDialog and DialogBox
# DialogProc is an App-defined callback function used with the CreateDialog and DialogBox
# families of functions. It processes messages sent to a modal or modeless dialog box. The DLGPROC
# type defines a pointer to this callback function. DialogProc is a placeholder for the
# application-defined function name.
# App-defined function name.
#
# [*Syntax*] INT_PTR CALLBACK DialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
#
Expand Down Expand Up @@ -232,7 +232,7 @@ module Dialog
# ---
# *Remarks*:
# GetDlgCtrlID accepts child window handles as well as handles of controls in dialog boxes. An
# application sets the identifier for a child window when it creates the window by assigning the
# App sets the identifier for a child window when it creates the window by assigning the
# identifier value to the hmenu parameter when calling the CreateWindow or CreateWindowEx function.
# Although GetDlgCtrlID may return a value if hwndCtl is a handle to a top-level window, top-level
# windows cannot have identifiers and such a return value is never valid.
Expand All @@ -251,7 +251,7 @@ module Dialog
# MessageBox Function
# --------------------------------------------------------------------------------
# The MessageBox function creates, displays, and operates a message box. The message box contains an
# application-defined message and title, along with any combination of predefined icons and push
# App-defined message and title, along with any combination of predefined icons and push
# buttons.
#
# [*Syntax*] int MessageBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType );
Expand Down

0 comments on commit 0218233

Please sign in to comment.