Windows API Headers III v.1.04

Started by José Roca, August 03, 2012, 09:28:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James A Gant

Jose,

Thank you very much for all the work you have put into these.

James A. Gant
  •  

Randall Glass

I have the Powerbasic 9.05.

Where can I get the old headers?

Lassar

RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
http://radiotelephonetutor.com
  •  

José Roca

  •  

Patrice Terrier

José

The GetProcessHandleFromHwnd API seems to be missing in the OleAcc.inc

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com
  •  

José Roca

  •  

José Roca

I will add it to OleAcc.inc, but it is not included in any of the versions of OleAcc.h that I have.


' // Documented, but not included in OleAcc.h
DECLARE FUNCTION GetProcessHandleFromHwnd IMPORT "OLEACC.DLL" ALIAS "GetProcessHandleFromHwnd" ( _
   BYVAL hwnd AS DWORD _                                ' __in HWND hwnd
) AS DWORD                                             ' HANDLE

  •  


José Roca

Yet, it is documented in MSDN, but not included in the headers.
  •  

Patrice Terrier

It comes up to be very handy when you need to interact with external process.

Here is an example of use:

FUNCTION ExeTerminate(BYVAL hWnd AS DWORD) AS LONG
    IF IsWindow(hWnd) THEN
        LOCAL hProcess AS DWORD
        hProcess = GetProcessHandleFromHwnd(hWnd)
        IF hProcess THEN
           IF TerminateProcess(hProcess, 9) THEN
              WaitForInputIdle(hProcess, %INFINITE)
              FUNCTION = %TRUE
           END IF
        END IF
    END IF
END FUNCTION
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com
  •  


Theo Gottwald

#25
548 Downloads this version. I am using these only ...

In SciCtrl.inc looks like there are a few bugs inside.
One is the

SCI_AutocSetSeparator()

It needs an ASC-Value as Parameter, not a STRPTR().

FUNCTION SCI_AutocSetSeparator (BYVAL hSci AS DWORD, BYVAL strSeparator AS BYTE) AS LONG
   FUNCTION = SendMessageA(hSci, %SCI_AUTOCSETSEPARATOR, strSeparator, 0)
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION SCIP_AutocSetSeparator (BYVAL pSci AS DWORD, BYVAL strSeparator AS BYTE) AS LONG
   FUNCTION = Scintilla_DirectFunction(pSci, %SCI_AUTOCSETSEPARATOR, strSeparator, 0)
END FUNCTION   

José Roca

THis should be easier to use with PB.


' ========================================================================================
FUNCTION SCI_AutocSetSeparator (BYVAL hSci AS DWORD, BYVAL strSeparator AS STRING) AS LONG
   FUNCTION = SendMessageA(hSci, %SCI_AUTOCSETSEPARATOR, ASC(strSeparator), 0)
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION SCIP_AutocSetSeparator (BYVAL pSci AS DWORD, BYVAL strSeparator AS STRING) AS LONG
   FUNCTION = Scintilla_DirectFunction(pSci, %SCI_AUTOCSETSEPARATOR, ASC(strSeparator), 0)
END FUNCTION
' ========================================================================================

  •  

Theo Gottwald

Of course, Jose, because you can just write

SCIP_AutocSetSeparator (pSci," ")
instead of
SCIP_AutocSetSeparator (pSci,32)

I found this some weeks before, there may be few more such cases in the include file.


Paul Squires

Edit_GetRightMargin is spelled incorrectly in "EditCtrl.inc". The "h" and the "t" are reversed.


' ========================================================================================
' Gets the width of the right margin for an edit control.
' ========================================================================================
FUNCTION Edit_GetRigthMargin (BYVAL hEdit AS DWORD) AS LONG
   FUNCTION = HI(WORD, SendMessage(hEdit, %EM_GETMARGINS, 0, 0))
END FUNCTION
' ========================================================================================


"Rigth" should be "Right"

Not sure if this was already fixed but I just came across it today while working on some code.

Paul Squires
FireFly Visual Designer SQLitening Database System JellyFish Pro Editor
http://www.planetsquires.com
  •  

José Roca

Thanks very much. I will post a new version soon, since I have updated some third party libraries and did some minor corrections to other files.
  •