WinAPI Library (1163 example codes)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

WinAPI Library (1163 example codes)

Post 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
Image
Image
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: WinAPI Library (1.052)

Post 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
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 543
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: WinAPI Library (1.052)

Post by bbanelli »

Absolutely fantastic!

Will you be going through the code for verification after users submission?
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: WinAPI Library (1.052)

Post 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
User avatar
majikeyric
Enthusiast
Enthusiast
Posts: 179
Joined: Mon Oct 21, 2013 5:21 pm
Location: France
Contact:

Re: WinAPI Library (1.052)

Post by majikeyric »

Many thanks ! :)
GoodNPlenty
Enthusiast
Enthusiast
Posts: 107
Joined: Wed May 13, 2009 8:38 am
Location: Arizona, USA

Re: WinAPI Library (1.052)

Post by GoodNPlenty »

Well Done. Thank You for sharing. :D
User avatar
minimy
Enthusiast
Enthusiast
Posts: 344
Joined: Mon Jul 08, 2013 8:43 pm

Re: WinAPI Library (1.052)

Post by minimy »

Very good, Thanks a lot!
If translation=Error: reply="Sorry, Im Spanish": Endif
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: WinAPI Library (1.052)

Post by swan »

Yep ! Very good. Thanx .....
User avatar
aaaaaaaargh
User
User
Posts: 55
Joined: Thu Jul 27, 2006 1:24 pm

Re: WinAPI Library (1.052)

Post by aaaaaaaargh »

Awesome :shock: !
missile69
User
User
Posts: 25
Joined: Mon Feb 21, 2011 12:15 pm

Re: WinAPI Library (1.052)

Post by missile69 »

Awesome contribution, RSBasic. This is will be really handy. Thanks!
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: WinAPI Library (1.052)

Post 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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: WinAPI Library (1.052)

Post 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).
le_magn
Enthusiast
Enthusiast
Posts: 133
Joined: Wed Aug 24, 2005 12:11 pm
Location: Italia
Contact:

Re: WinAPI Library (1.052)

Post by le_magn »

Thank you for this great tool!!!!!
Image
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: WinAPI Library (1.052)

Post 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?
Image
Image
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: WinAPI Library (1.052)

Post 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
Post Reply