José Roca Forum
Web Site
News: Version 4.0.14 of the TypeLib Browser released
 
*
Welcome, Guest. Please login or register. September 09, 2010, 02:42:19 PM


Login with username, password and session length


PowerBASIC is a trademark of PowerBASIC, Inc.
This is not an official PowerBASIC site and we are not affiliated with PowerBASIC, Inc.
DISCLAIMER: The software and accompanying documentation are provided "as is" and without warranties as to performance or merchantability or any other warranties whether expressed or implied. Because of the various hardware environments into which the software may be used, no warranty of fitness for a particular purpose is offered. The user must assume the entire risk of using the software. In no case shall any of the contributors to this project be liable for any incidental, special or consequential damages or loss, including, without limitation, lost profits or the inability to use equipment or access data. This is true even if we are advised of the possibility of such damages. We also don't have any obligation of fix eventual bugs or to add new features.
Pages: 1 2 3 4 »   Go Down
  Print  
Author Topic: Windows API Headers v. 1.16  (Read 2311 times)
0 Members and 1 Guest are viewing this topic.
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« on: July 02, 2010, 11:53:13 PM »

 
This project is an effort to translate the C headers of the Microsoft Platform SDK for Windows to PowerBASIC™. This version has been updated using the SDK for Windows 7.

These headers are freeware, not public domain. This means that you can use them for your own purposes, even in commercial applications, without paying a fee, but not to make derivative works from, sell or redistribute without permission. Also you must assume the entire risk of using them. Downloading the software indicates that you accept these terms.

Because of the use of new data types only available in PNWIN 9.0+ and PBCC 5.0+, and the inclusion of interface definitions, they can only be used with the new compilers.

You must also be aware that these headers are not extensions to the ones provided with the compiler, but a full replacement. Therefore, you must not mix them with the PowerBASIC include files in any way, neither directly (via #INCLUDE), nor indirectly (via the include path in the IDE).

Unzip the attached file to a folder of your choice and replace the PB Include path in the PB Ide or the editor that you are using to that folder instead of C:\PBWin90\WinApi.

The wrapper functions for the Common Controls have been removed from CommCtrl.inc and placed in the following individual files. Therefore, the use of constants such %NOTOOLBAR, %NOUPDOWN, etc., is no longer needed. Just #INCLUDE the wanted files in your application.

AnimateCtrl.inc (Animation control)
ButtonCtrl.inc (Button control)
ComboBoxCtrl.inc (ComboBox control)
ComboBoxExCtrl.inc (ComboBoxEx control)
DateTimeCtrl.inc (Date Time control)
EditCtrl.inc (Edit control)
HeaderCtrl.inc (Header control)
HotKeyCtrl.inc (Hot Key control)
IPAddressCtrl.inc (IP Address control)
ListBoxCtrl.inc (ListBox control)
ListViewCtrl.inc (ListView control)
MonthCalCtrl.inc (Month Calendar control)
PagerCtrl.inc (Pager control)
ProgressBarCtrl.inc (Progress Bar control)
RebarCtrl.inc (Rebar control)
RichEditCtrl.inc (Rich Edit control)
ScrollBarCtrl.inc (Scroll Bar control)
StaticCtrl.inc (Static control)
StatusbarCtrl.inc (Status Bar control)
SysLinkCtrl.inc (SysLink control)
TabCtrl.inc (Tab control)
TaskDialogCtrl.inc (Task Dialog control)
ToolbarCtrl.inc (Toolbar control)
TrackbarCtrl.inc (Track Bar control)
TreeViewCtrl.inc (TreeView control)
UpDownCtrl.inc (UpDown control)

Note: For compatibility with the PB Winapi include files, the file ComboCtrl.inc includes wrapper functions that use "Combo_", instead of "ComboBox_", as the prefix.

There are 1,080 files using about 70 MB of disk space.
« Last Edit: August 13, 2010, 12:05:45 AM by José Roca » Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #1 on: July 03, 2010, 12:06:03 AM »

 
This update allows the use of Direct 2D with PowerBASIC 9.0.

The following code is an adaptation of Microsoft C++ Direct2D GDI Interop Sample. See: http://msdn.microsoft.com/en-us/library/dd370982%28VS.85%29.aspx

Code:
#COMPILE EXE
#DIM ALL
#INCLUDE "d2d1.inc"
#INCLUDE "d2d1Helper.inc"

GLOBAL g_pD2DFactory AS ID2D1Factory
GLOBAL g_pDCRT AS ID2D1DCRenderTarget
GLOBAL g_pBlackBrush AS ID2D1SolidColorBrush
GLOBAL g_pID2D1Helper AS ID2D1Helper

' ========================================================================================
'*
'*  This function creates resources which are bound to a particular D3D device. It's all
'*  centralized here, in case the resources need to be recreated in case of D3D device
'*  loss (eg. display change, remoting, removal of video card, etc).
'*
' ========================================================================================
FUNCTION CreateDeviceResources () AS LONG

   LOCAL hr AS LONG

   IF ISNOTHING(g_pDCRT) THEN
      ' // Create a DC render target.
      LOCAL props AS D2D1_RENDER_TARGET_PROPERTIES
      props = g_pID2D1Helper.RenderTargetProperties(%D2D1_RENDER_TARGET_TYPE_DEFAULT, _
              g_pID2D1Helper.PixelFormat(%DXGI_FORMAT_B8G8R8A8_UNORM, %D2D1_ALPHA_MODE_IGNORE), _
              0, 0, %D2D1_RENDER_TARGET_USAGE_NONE, %D2D1_FEATURE_LEVEL_DEFAULT)

      hr = g_pD2DFactory.CreateDCRenderTarget(props, g_pDCRT)
      IF SUCCEEDED(hr) THEN
         ' // Create a black brush.
         hr = g_pDCRT.CreateSolidColorBrush( _
              g_pID2D1Helper.ColorF_3(%D2D1_Black, 1.0!), _
              BYVAL %NULL, _
              g_pBlackBrush)
      END IF
   END IF

   FUNCTION = hr

END FUNCTION
' ========================================================================================

' ========================================================================================
'*
'*  Discard device-specific resources which need to be recreated when a D3D device is lost
'*
' ========================================================================================
SUB DiscardDeviceResources
   g_pDCRT = NOTHING
   g_pBlackBrush = NOTHING
END SUB
' ========================================================================================

' ========================================================================================
'*  This function draws Direct2D content to a GDI HDC.
'*
'*  This function will automatically discard device-specific resources if the D3D device
'*  disappears during function invocation, and will recreate the resources the next time
'*  it's invoked.
'*
' ========================================================================================
FUNCTION OnRender (BYVAL hwnd AS DWORD, BYREF ps AS PAINTSTRUCT) AS LONG

   LOCAL hr AS LONG
   LOCAL rc AS RECT

   ' // Get the dimensions of the client drawing area.
   GetClientRect(hwnd, rc)

   ' // Draw the pie chart with Direct2D.

   ' // Create the DC render target.
   hr = CreateDeviceResources

   IF SUCCEEDED(hr) THEN
      ' // Bind the DC to the DC render target.
      hr = g_pDCRT.BindDC(ps.hdc, rc)
      g_pDCRT.BeginDraw
      g_pDCRT.SetTransform(g_pID2D1Helper.IdentityMatrix)
      g_pDCRT.Clear(g_pID2D1Helper.ColorF_3(%D2D1_White, 1.0!))

      g_pDCRT.DrawEllipse( _
         g_pID2D1Helper.Ellipse( _
            g_pID2D1Helper.Point2F(150.0!, 150.0!), _
            100.0!, _
            100.0!), _
         g_pBlackBrush, 3.0!)

      LOCAL point0, point1 AS D2D1_POINT_2F
      point0 = g_pID2D1Helper.Point2F(150.0!, 150.0!)
      point1 = g_pID2D1Helper.Point2F( _
                  150.0! + 100.0! * 0.15425!, _
                  150.0! - 100.0! * 0.988!)
      g_pDCRT.DrawLine( _
         point0, _
         point1, _
         g_pBlackBrush, 3.0!)

      point0 = g_pID2D1Helper.Point2F(150.0!, 150.0!)
      point1 = g_pID2D1Helper.Point2F( _
                  150.0! + 100.0! * 0.525!, _
                  150.0! + 100.0! * 0.8509!)
      g_pDCRT.DrawLine( _
         point0, _
         point1, _
         g_pBlackBrush, 3.0!)

      point0 = g_pID2D1Helper.Point2F(150.0!, 150.0!)
      point1 = g_pID2D1Helper.Point2F( _
                  150.0! - 100.0! * 0.988!, _
                  150.0! - 100.0! * 0.15425!)
      g_pDCRT.DrawLine( _
         point0, _
         point1, _
         g_pBlackBrush, 3.0!)

      hr = g_pDCRT.EndDraw
      IF SUCCEEDED(hr) THEN
         ' //
         ' // Draw the pie chart with GDI.
         ' //

         ' // Save the original object.
         LOCAL original AS DWORD
         original = SelectObject(ps.hdc, GetStockObject(%DC_PEN))

         LOCAL blackPen AS WORD
         blackPen = CreatePen(%PS_SOLID, 3, 0)
         SelectObject(ps.hdc, blackPen)

         Ellipse(ps.hdc, 300, 50, 500, 250)

         DIM pntArray1(1) AS POINT
         pntArray1(0).x = 400
         pntArray1(0).y = 150
         pntArray1(1).x = 400 + 100 * 0.15425
         pntArray1(1).y = 150 - 100 * 0.9885

         DIM pntArray2(2) AS POINT
         pntArray2(0).x = 400
         pntArray2(0).y = 150
         pntArray2(1).x = 400 + 100 * 0.525
         pntArray2(1).y = 150 + 100 * 0.8509

         DIM pntArray3(2) AS POINT
         pntArray3(0).x = 400
         pntArray3(0).y = 150
         pntArray3(1).x = 400 - 100 * 0.988
         pntArray3(1).y = 150 - 100 * 0.15425

         Polyline(ps.hdc, pntArray1(0), 2)
         Polyline(ps.hdc, pntArray2(0), 2)
         Polyline(ps.hdc, pntArray3(0), 2)

         DeleteObject(blackPen)

         ' // Restore the original object.
         SelectObject(ps.hdc, original)
      END IF
   END IF

   IF hr = %D2DERR_RECREATE_TARGET THEN
      hr = %S_OK
      DiscardDeviceResources
   END IF

   FUNCTION = hr

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main
' ========================================================================================
FUNCTION WinMain (BYVAL hInstance AS DWORD, BYVAL hPrevInstance AS DWORD, BYVAL lpszCmdLine AS ASCIIZ PTR, BYVAL nCmdShow AS LONG) AS LONG

   LOCAL hr          AS LONG
   LOCAL hWndMain    AS DWORD
   LOCAL wcex        AS WNDCLASSEX
   LOCAL szClassName AS ASCIIZ * 80
   LOCAL rc          AS RECT
   LOCAL szCaption   AS ASCIIZ * 255

   ' // Create D2D factory
'   hr = D2D1CreateFactory(%D2D1_FACTORY_TYPE_SINGLE_THREADED, $IID_ID2D1Factory, BYVAL %NULL, g_pD2DFactory)
   hr = D2D1CreateFactory2(%D2D1_FACTORY_TYPE_SINGLE_THREADED, g_pD2DFactory)
   IF ISNOTHING(g_pD2DFactory) THEN EXIT FUNCTION

   ' // Create an instance of the CD2D1Helper class
   g_pID2D1Helper = CLASS "CD2D1Helper"
   IF ISNOTHING(g_pID2D1Helper) THEN EXIT FUNCTION

   ' Register the window class
   szClassName        = "D2DDemoApp"
   wcex.cbSize        = SIZEOF(wcex)
   wcex.style         = %CS_HREDRAW OR %CS_VREDRAW
   wcex.lpfnWndProc   = CODEPTR(WndProc)
   wcex.cbClsExtra    = 0
   wcex.cbWndExtra    = 0
   wcex.hInstance     = hInstance
   wcex.hCursor       = LoadCursor (%NULL, BYVAL %IDC_ARROW)
   wcex.hbrBackground = %COLOR_3DFACE + 1
   wcex.lpszMenuName  = %NULL
   wcex.lpszClassName = VARPTR(szClassName)
   wcex.hIcon         = LoadIcon (%NULL, BYVAL %IDI_APPLICATION) ' Sample, if resource icon: LoadIcon(hInst, "APPICON")
   wcex.hIconSm       = LoadIcon (%NULL, BYVAL %IDI_APPLICATION) ' Remember to set small icon too..
   RegisterClassEx wcex

   ' // Create the application window.
   ' //
   ' // Because the CreateWindow function takes its size in pixels, we
   ' // obtain the system DPI and use it to scale the window size.
   LOCAL dpiX, dpiY AS SINGLE
   g_pD2DFactory.GetDesktopDpi(dpiX, dpiY)

   ' Window caption
   szCaption = "Direct2D Demo App"

   ' Create a window using the registered class
   hWndMain = CreateWindowEx(%WS_EX_CONTROLPARENT, _           ' extended style
                             szClassName, _                    ' window class name
                             szCaption, _                      ' window caption
                             %WS_OVERLAPPEDWINDOW, _           ' window styles
                             %CW_USEDEFAULT, _                 ' initial x position
                             %CW_USEDEFAULT, _                 ' initial y position
                             CEIL(600 * dpiX / 96), _          ' initial x size
                             CEIL(400 * dpiY / 96), _          ' initial y size
                             %NULL, _                          ' parent window handle
                             0, _                              ' window menu handle
                             hInstance, _                      ' program instance handle
                             BYVAL %NULL)                      ' creation parameters

   ' Show the window
   ShowWindow hWndMain, nCmdShow
   UpdateWindow hWndMain

   ' Message handler loop
   LOCAL uMsg AS tagMsg
   WHILE GetMessage(uMsg, %NULL, 0, 0)
      IF ISFALSE IsDialogMessage(hWndMain, uMsg) THEN
         TranslateMessage uMsg
         DispatchMessage uMsg
      END IF
   WEND

   FUNCTION = uMsg.wParam

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main Window procedure
' ========================================================================================
FUNCTION WndProc (BYVAL hWnd AS DWORD, BYVAL wMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LONG) AS LONG

   LOCAL rc AS RECT

   SELECT CASE wMsg

      CASE %WM_COMMAND
         SELECT CASE LO(WORD, wParam)
            CASE %IDCANCEL
               IF HI(WORD, wParam) = %BN_CLICKED THEN
                  SendMessage hWnd, %WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF

         END SELECT

      CASE %WM_SYSCOMMAND
         ' Capture this message and send a WM_CLOSE message
         IF (wParam AND &HFFF0) = %SC_CLOSE THEN
            SendMessage hWnd, %WM_CLOSE, 0, 0
            EXIT FUNCTION
         END IF

      CASE %WM_PAINT, %WM_DISPLAYCHANGE
         LOCAL ps AS PAINTSTRUCT
         BeginPaint(hwnd, ps)
         OnRender(hwnd, ps)
         EndPaint(hwnd, ps)
         EXIT FUNCTION

      CASE %WM_DESTROY
         PostQuitMessage 0
         EXIT FUNCTION

   END SELECT

   FUNCTION = DefWindowProc(hWnd, wMsg, wParam, lParam)

END FUNCTION
' ========================================================================================
Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #2 on: July 03, 2010, 03:24:10 AM »

 
For some reason, MSCOMCT2.OCX is not installed in Windows 7.

You can download Microsoft Windows Common Controls-2 6.0 from the following Microsoft Web site:

http://activex.microsoft.com/controls/vb6/MSCOMCT2.CAB

I also have read about problems registering this ActiveX control in 64 bit OSes.

My OLE container (OLECON.INC) allows to use it without having to register it.

Here is an example of how to create a registration-free instance of the MonthView control:

Code:
' ########################################################################################
' Test for the MonthView control
' ########################################################################################

' SED_PBWIN - Use the PBWIN compiler
#COMPILE EXE
#DIM ALL
#INCLUDE ONCE "OLECON.INC"      ' // Ole Container
#INCLUDE ONCE "MSCOMCT2.INC"    ' // Microsoft Windows Common Controls-2 6.0 (SP4)

%IDC_MONTHVIEW = 101

' ========================================================================================
' Main
' ========================================================================================
FUNCTION WINMAIN (BYVAL hInstance AS DWORD, BYVAL hPrevInstance AS DWORD, BYVAL lpszCmdLine AS ASCIIZ PTR, BYVAL nCmdShow AS LONG) AS LONG

   LOCAL hWndMain    AS DWORD
   LOCAL hFont       AS DWORD
   LOCAL wcex        AS WNDCLASSEX
   LOCAL szClassName AS ASCIIZ * 80
   LOCAL rc          AS RECT
   LOCAL szCaption   AS ASCIIZ * 255
   LOCAL nLeft       AS LONG
   LOCAL nTop        AS LONG
   LOCAL nWidth      AS LONG
   LOCAL nHeight     AS LONG

   ' Required: Initialize the OLE Container
   OC_WinInit

   hFont = GetStockObject(%ANSI_VAR_FONT)

   ' Register the window class
   szClassName        = "MonthView"
   wcex.cbSize        = SIZEOF(wcex)
   wcex.style         = 0 '%CS_HREDRAW OR %CS_VREDRAW
   wcex.lpfnWndProc   = CODEPTR(WndProc)
   wcex.cbClsExtra    = 0
   wcex.cbWndExtra    = 0
   wcex.hInstance     = hInstance
   wcex.hCursor       = LoadCursor (%NULL, BYVAL %IDC_ARROW)
   wcex.hbrBackground = %COLOR_3DFACE + 1
   wcex.lpszMenuName  = %NULL
   wcex.lpszClassName = VARPTR(szClassName)
   wcex.hIcon         = LoadIcon (%NULL, BYVAL %IDI_APPLICATION) ' Sample, if resource icon: LoadIcon(hInst, "APPICON")
   wcex.hIconSm       = LoadIcon (%NULL, BYVAL %IDI_APPLICATION) ' Remember to set small icon too..
   RegisterClassEx wcex

   ' Window caption
   szCaption = "Monthview Control Demo"

   ' Retrieve the size of the working area
   SystemParametersInfo %SPI_GETWORKAREA, 0, BYVAL VARPTR(rc), 0

   ' Calculate the position and size of the window
   nWidth  = (((rc.nRight - rc.nLeft)) + 2) * 0.75   ' 75% of the client screen width
   nHeight = (((rc.nBottom - rc.nTop)) + 2) * 0.70   ' 70% of the client screen height
   nLeft   = ((rc.nRight - rc.nLeft) \ 2) - nWidth \ 2
   nTop    = ((rc.nBottom - rc.nTop) \ 2) - (nHeight \ 2)

   ' Create a window using the registered class
   hWndMain = CreateWindowEx(%WS_EX_CONTROLPARENT, _           ' extended style
                             szClassName, _                    ' window class name
                             szCaption, _                      ' window caption
                             %WS_OVERLAPPEDWINDOW OR _
                             %WS_CLIPCHILDREN, _               ' window style
                             nLeft, _                          ' initial x position
                             nTop, _                           ' initial y position
                             nWidth, _                         ' initial x size
                             nHeight, _                        ' initial y size
                             %NULL, _                          ' parent window handle
                             0, _                              ' window menu handle
                             hInstance, _                      ' program instance handle
                             BYVAL %NULL)                      ' creation parameters

   ' Show the window
   ShowWindow hWndMain, nCmdShow
   UpdateWindow hWndMain

   ' Message handler loop
   LOCAL uMsg AS tagMsg
   WHILE GetMessage(uMsg, %NULL, 0, 0)
      IF ISFALSE OC_ForwardMessage(GetFocus, uMsg) THEN
         IF IsDialogMessage(hWndMain, uMsg) = 0 THEN
            TranslateMessage uMsg
            DispatchMessage uMsg
         END IF
      END IF
   WEND

   FUNCTION = uMsg.wParam

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main Window procedure
' ========================================================================================
FUNCTION WndProc (BYVAL hWnd AS DWORD, BYVAL wMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LONG) AS LONG

   LOCAL hr         AS LONG
   LOCAL hMonthView AS DWORD
   LOCAL rc         AS RECT
   LOCAL pMonthView AS MSComCtl2_IMonthView

   SELECT CASE wMsg

      CASE %WM_CREATE

         ' Create a registration-free instance of the control
         LOCAL  cp AS OC_CREATEPARAMS
         cp.clsid = $CLSID_MSComCtl2_MonthView
         cp.riid = $IID_MSComCtl2_IMonthView
         cp.szLicKey = $RTLKEY_MSCOMCT2
         cp.szLibName = EXE.Path$ & "MSCOMCT2.OCX"
         hMonthView = CreateWindowEx(0, $OC_CLASSNAME, "", %WS_CHILD OR %WS_VISIBLE, _
            0, 0, 0, 0, hWnd, %IDC_MONTHVIEW, GetModuleHandle(BYVAL %NULL), cp)

         ' Set the focus in the control
         SetFocus hMonthView

      CASE %WM_SIZE
         ' Resizes the control
         IF wParam <> %SIZE_MINIMIZED THEN
            GetClientRect hWnd, rc
            MoveWindow GetDlgItem(hWnd, %IDC_MONTHVIEW), 0, 0, rc.nRight - rc.nLeft, rc.nBottom - rc.nTop, %TRUE
         END IF

      CASE %WM_COMMAND
         SELECT CASE LO(WORD, wParam)
            CASE %IDCANCEL
               IF HI(WORD, wParam) = %BN_CLICKED THEN
                  SendMessage hWnd, %WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF
         END SELECT

      CASE %WM_SYSCOMMAND
         ' Capture this message and send a WM_CLOSE message
         IF (wParam AND &HFFF0) = %SC_CLOSE THEN
            SendMessage hWnd, %WM_CLOSE, 0, 0
            EXIT FUNCTION
         END IF

      CASE %WM_DESTROY
         PostQuitMessage 0
         EXIT FUNCTION

   END SELECT

   FUNCTION = DefWindowProc(hWnd, wMsg, wParam, lParam)

END FUNCTION
' ========================================================================================
Logged
Jürgen Huhn
Full Member
***

Karma: 4
Offline Offline

Gender: Male
Posts: 128



« Reply #3 on: July 03, 2010, 04:00:27 AM »

Very nice work Jose! Straight forward to Windows7....
I downloded the Update and your Main Messageloop is also perfekt.

   ' Message handler loop
   LOCAL uMsg AS tagMsg
   WHILE GetMessage(uMsg, %NULL, 0, 0)
      IF ISFALSE IsDialogMessage(hWndMain, uMsg) THEN  ' <_ no Dialogmessages
         TranslateMessage uMsg
         DispatchMessage uMsg
      END IF
   WEND
...
Logged

.¸.•’´¯)¸.•’´¯)¸.•’´¯)¸.•’´¯)
¤ª“˜¨¨¯¯¨¨˜“ª¤....¤ ª“˜¨
Patrice Terrier
Global Moderator
Hero Member
*****

Karma: 36
Offline Offline

Gender: Male
Posts: 1353


WWW
« Reply #4 on: July 03, 2010, 10:03:45 AM »

Thank you José for this great upgrade!

...
Logged

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com
Tiziano Magni
Newbie
*

Karma: 0
Offline Offline

Posts: 6


« Reply #5 on: July 03, 2010, 11:06:06 AM »

A must have upgrade.
Many thanks!

Tiziano Magni
Logged
Edwin Knoppert
Sr. Member
****

Karma: 1
Offline Offline

Gender: Male
Posts: 456



WWW
« Reply #6 on: July 03, 2010, 12:41:53 PM »

Must be a *very* time-consuming job!

Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #7 on: July 03, 2010, 03:54:10 PM »

 
Sorry Tiziano, I forgot to add:

Code:
         #IF %DEF(%PB_WIN32)
         MOUSEPTR 1   ' Arrow cursor
         #ENDIF

Please, do it yourself and I promise that the next time I won't forget.

Note for lurkers: It's only intended to allow to compile it with PBCC.
Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #8 on: July 03, 2010, 04:10:10 PM »

 
Quote
Must be a *very* time-consuming job!

Time consuming and boring, but needed. There is not other way to have access to the new technologies.

One of the most boring things has been to check the alignment of the about 7,800 types and unions, and adding packing members to them when needed. A lot of the new structures must be 8 byte aligned because have members that are quads.
Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #9 on: July 03, 2010, 04:17:21 PM »

 
Patrice,

I have translated ntifs.h, that includes your beloved Rtlxxx functions Smiley

There is a lot of remed stuff in ntifs.inc, but it does not mean that has not been translated, but that is available in other include files.
Logged
Tiziano Magni
Newbie
*

Karma: 0
Offline Offline

Posts: 6


« Reply #10 on: July 03, 2010, 07:02:50 PM »

Added!

Thank you again  Wink
Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #11 on: July 03, 2010, 09:13:02 PM »

 
The new headers allow te use of the Task Dialog Control.

A manifest file is needed to enable visual styles.

Save it as TaskDialog.xml:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="X86"
    name="TaskDialog"
    type="win32"
/>
<description>Your application description here.</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

This manifest file has to be included in a resource file.

Save it as TaskDialog.rc:

Code:
1 24 "TaskDialog.xml"

Compile the .rc file to get a .pbr file and include it in your application.

Code:
#RESOURCE "TaskDialog.pbr"

Now you are ready to use the Task Dialog Control.

Example:

Code:
#COMPILE EXE
#DIM ALL
#INCLUDE "windows.inc"
#INCLUDE "commctrl.inc"
#RESOURCE "TaskDialog.pbr"

FUNCTION PBMAIN () AS LONG

   LOCAL hr AS LONG
   LOCAL nClickedButton AS LONG
   LOCAL bstrTitle AS STRING
   bstrTitle = UCODE$("Windows API Headers")
   LOCAL bstrHeader AS STRING
   bstrHeader = UCODE$("Windows API Headers")
   LOCAL bstrBodyText AS STRING
   bstrBodyText = UCODE$("An update for the Windows API headers has just been released")

   hr = TaskDialog(0, %NULL, _
                   STRPTR(bstrTitle), STRPTR(bstrHeader), STRPTR(bstrBodyText), _
                   %TDCBF_YES_BUTTON OR %TDCBF_NO_BUTTON, _
                   %TD_INFORMATION_ICON, nClickedButton)

END FUNCTION


« Last Edit: July 03, 2010, 09:20:40 PM by José Roca » Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #12 on: July 03, 2010, 09:15:28 PM »

 
A variation of the former example using the L_ macro included in Ole2Utils.inc:

Code:
#COMPILE EXE
#DIM ALL
#INCLUDE "windows.inc"
#INCLUDE "commctrl.inc"
#INCLUDE "Ole2Utils.inc"
#RESOURCE "TaskDialog.pbr"

FUNCTION PBMAIN () AS LONG

   LOCAL hr AS LONG
   LOCAL nClickedButton AS LONG

   hr = TaskDialog(0, %NULL, _
                   L_("Windows API Headers"), _
                   L_("Windows API Headers"), _
                   L_("An update for the Windows API headers has just been released"), _
                   %TDCBF_YES_BUTTON OR %TDCBF_NO_BUTTON, _
                   %TD_INFORMATION_ICON, nClickedButton)

END FUNCTION
Logged
José Roca
Administrator
Hero Member
*****

Karma: 136
Offline Offline

Gender: Male
Posts: 3681



WWW
« Reply #13 on: July 03, 2010, 09:19:51 PM »

 
Users of the SED editor don't need to create and include a resource file if they have the Menu-->Options-->Editor-->Attach resources option checked. Instead, they can include the contents of the .rc file in the form of '%RC TEXT comments, e.g.

Code:
#COMPILE EXE
#DIM ALL
#INCLUDE "windows.inc"
#INCLUDE "commctrl.inc"
#INCLUDE "Ole2Utils.inc"
'%RC TEXT 1 24 "TaskDialog.xml"

FUNCTION PBMAIN () AS LONG

   LOCAL hr AS LONG
   LOCAL nClickedButton AS LONG

   hr = TaskDialog(0, %NULL, _
                   L_("Windows API Headers"), _
                   L_("Windows API Headers"), _
                   L_("An update for the Windows API headers has just been released"), _
                   %TDCBF_YES_BUTTON OR %TDCBF_NO_BUTTON, _
                   %TD_INFORMATION_ICON, nClickedButton)

END FUNCTION
« Last Edit: July 05, 2010, 07:11:56 AM by José Roca » Logged
Edwin Knoppert
Sr. Member
****

Karma: 1
Offline Offline

Gender: Male
Posts: 456



WWW
« Reply #14 on: July 04, 2010, 12:33:01 AM »

A PB example for tasklist and progress-in-taskbarbutton would be nice Smiley
I have just extracted your zip under w7 and it shows the progress in the taskbar.
Logged
Pages: 1 2 3 4 »   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

IMPRESSUM
Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.123 seconds with 18 queries.