Results 1 to 10 of 570

Thread: Tests Copying, Pasting, API Cliipboard issues. and Rough notes on Advanced API stuff

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    MessageBoxÆ function
    The standard/ old Declareation looks like this
    Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
    In this case disappointingly, the string arguments are given As String
    However, take a look at the moderner documentation. ( That is usually in C language , but translating them is usually straight forward. )
    int MessageBoxA(
    [in, optional] HWND hWnd,
    [in, optional] LPCSTR lpText,
    [in, optional] LPCSTR lpCaption,
    [in] UINT uType
    );
    int MessageBoxW(
    [in, optional] HWND hWnd,
    [in, optional] LPCWSTR lpText,
    [in, optional] LPCWSTR lpCaption,
    [in] UINT uType
    );

    Encouraging we see the pointer stuff is there on the two string arguments.
    So
    We is trying to get something that very likely does a Unicode thing, as much as possible. That is to say the provisional Ælstein Theory proclamates something like:
    _ Behold: I have seen a API World, where direct ANSI Strings stuff is often avoided, or at least cropped back / restrained a bit, and that World is good. In this regard, String is anything at a API Declare line or related main code lines. This will include anything in API related VBA code lines that include As String
    _In VBA, VB and possibly in other computer things, much involving string manipulations involves the handling not directly of the string itself, but of numbers: addresses of a Long type. This may be able to be exploited, when the string manipulation involves simple transferring: We can try to pass a pointer. This may effectively being something like a ByRef, when it is ByVal declared. This can help reduce certain conflicts associated with an actual explicit ByRef usage
    (We note possible parallels here to hacks to arguments in VBA Application.Run)

    Worked example
    I got an interesting word, or rather interesting first character of a word, in the first cell of a worksheet
    Whilst Excel seems very good with displaying a massive amount of exotic high up the Unicode list characters, initially both the inbuilt VBA MsgBox and initially the API MessageBoxA don’t do at all well, not even if it's an ANSI that is probably not on my code page .


    later.....
    Last edited by DocAElstein; 02-15-2025 at 01:21 PM.

Similar Threads

  1. Some Date Notes and Tests
    By DocAElstein in forum Test Area
    Replies: 5
    Last Post: 03-26-2025, 02:56 AM
  2. Replies: 116
    Last Post: 02-23-2025, 12:13 AM
  3. Replies: 21
    Last Post: 12-15-2024, 07:13 PM
  4. Replies: 42
    Last Post: 05-29-2023, 01:19 PM
  5. Replies: 11
    Last Post: 10-13-2013, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •