Page 1 of 4

WinAPI Library (1163 example codes)

Posted: Sat Aug 08, 2015 10:11 pm
by RSBasic
Good evening :)

I'm introducing you my WinAPI Library.
My library contains 1052 sample code for WinAPI.

Screenshot (old german screenshot :D ):
Image

My program is available in following languages:
  • German
  • English
  • Spanish
  • French
You can select language at first program start or you can change later in menu "Language".
All text in English, French and Spanish was translated by "Google Translate".
It may be possible that some texts are grammatically incorrect. Comments and strings in the PB files was not translated.

Have fun :)

Online: https://www.rsbasic.de/winapi-library
Offline: https://www.rsbasic.de/downloads/winapi_library.zip
Image

Re: WinAPI Library (1.052)

Posted: Sat Aug 08, 2015 10:54 pm
by infratec
Hi and welcome!

that's a great introduction :!:

But...
I personally avoid API like hell, to be crossplatform :D
The main reason why I'd choosen PB.

Bernd

Re: WinAPI Library (1.052)

Posted: Sat Aug 08, 2015 11:42 pm
by bbanelli
Absolutely fantastic!

Will you be going through the code for verification after users submission?

Re: WinAPI Library (1.052)

Posted: Sun Aug 09, 2015 11:18 am
by Vera
w°0°w ~ how cool is that ~ Image

Thanks so much Image
... and for the great coming fun to 'adjust' a translation to ones privat language ;)

greets ~ Vera

Re: WinAPI Library (1.052)

Posted: Sun Aug 09, 2015 12:24 pm
by majikeyric
Many thanks ! :)

Re: WinAPI Library (1.052)

Posted: Sun Aug 09, 2015 5:21 pm
by GoodNPlenty
Well Done. Thank You for sharing. :D

Re: WinAPI Library (1.052)

Posted: Sun Aug 09, 2015 10:39 pm
by minimy
Very good, Thanks a lot!

Re: WinAPI Library (1.052)

Posted: Mon Aug 10, 2015 12:28 am
by swan
Yep ! Very good. Thanx .....

Re: WinAPI Library (1.052)

Posted: Mon Aug 10, 2015 7:15 pm
by aaaaaaaargh
Awesome :shock: !

Re: WinAPI Library (1.052)

Posted: Tue Aug 11, 2015 6:31 am
by missile69
Awesome contribution, RSBasic. This is will be really handy. Thanks!

Re: WinAPI Library (1.052)

Posted: Tue Aug 11, 2015 7:18 am
by IdeasVacuum
Just browsing this lib has opened my eyes to many things I was not aware of 8)

...... one of which was this:
Remove frame of ButtonImageGadget

Code: Select all

ButtonImageGadget(1, 50, 50, 60, 60, ImageID(1), #BS_OWNERDRAW)
That works perfectly, but it leaves a white border around the button. How to make that border the same colour as the Window or Container back colour?

Re: WinAPI Library (1.052)

Posted: Tue Aug 11, 2015 10:19 am
by Little John
Many thanks for sharing!

I think in 3 code examples, SetWindowLong_() should be replaced with SetWindowLongPtr_()
(see PureBasic Team Blog - Porting your programs to PureBasic 64 bit).

Re: WinAPI Library (1.052)

Posted: Tue Aug 11, 2015 2:58 pm
by le_magn
Thank you for this great tool!!!!!

Re: WinAPI Library (1.052)

Posted: Sat Aug 15, 2015 12:42 pm
by RSBasic
@all
Many many thanks for your feedback. :)
bbanelli wrote:Will you be going through the code for verification after users submission?
I'm sorry, I don't understand you. What do you mean?
IdeasVacuum wrote:That works perfectly, but it leaves a white border around the button. How to make that border the same colour as the Window or Container back colour?
You're right. Code to change the background color:

Code: Select all

EnableExplicit

Global ButtonImageBC

CreateImage(1, 50, 50, 24, RGB(100, 200, 255))

Procedure WindowCallback(hWnd, uMsg, wParam, lParam)
  Select uMsg
    Case #WM_CTLCOLORBTN
      If lparam = GadgetID(1)
        ProcedureReturn ButtonImageBC
      EndIf
  EndSelect
  
  ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure

If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ButtonImageGadget(1, 50, 50, 60, 60, ImageID(1), #BS_OWNERDRAW)
  
  SetWindowColor(0, RGB(100, 255, 100))
  ButtonImageBC = CreateSolidBrush_(RGB(100, 255, 100))
  ;ButtonImageBC = CreateSolidBrush_(GetSysColor_(#COLOR_BTNFACE))
  
  SetWindowCallback(@WindowCallback())
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        DeleteObject_(ButtonImageBC)
        End
    EndSelect
  ForEver
EndIf
Little John wrote:I think in 3 code examples, SetWindowLong_() should be replaced with SetWindowLongPtr_().
Thank you. I'll replace it.

@le_magn
Profile information wrote:Location: Italia
Do you need an Italian translation?

Re: WinAPI Library (1.052)

Posted: Sun Aug 16, 2015 8:01 pm
by Vera
RSBasic wrote:
bbanelli wrote:Will you be going through the code for verification after users submission?
I'm sorry, I don't understand you. What do you mean?
If I may, I think this is meant:

If a user submits his code online [WinApiCode online einreichen], will you check the code to verify [bestätigen] if it is valid and correct [prüfen, ob der Code in Ordnung ist]?

Btw: I found a word which couldn't be translated into any other language: "Seitenweise" [by the pageful].
As it'll stay an automated translation in the future, it might be better to find a different expression like "Pro Seite nach oben scrollen" <-might become-> "Scroll up per page".

greets ~ Vera