Nuevo Foro de programacion
0 Usuarios y 1 Visitante están viendo este tema.
Option ExplicitPublic Declare Function ReleaseCapture Lib "user32" () As LongPublic Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPrivate Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As LongPrivate Declare Function CreateDIBSection Lib "gdi32.dll" (ByVal hdc As Long, pBitmapInfo As BITMAPINFO, ByVal un As Long, ByRef lplpVoid As Any, ByVal handle As Long, ByVal dw As Long) As LongPrivate Declare Function CreateCompatibleDC Lib "gdi32.dll" (ByVal hdc As Long) As LongPrivate Declare Function SelectObject Lib "gdi32.dll" (ByVal hdc As Long, ByVal hObject As Long) As LongPrivate Declare Function DeleteDC Lib "gdi32.dll" (ByVal hdc As Long) As LongPrivate Declare Function SetWindowPos Lib "user32.dll" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As LongPrivate Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPrivate Declare Function UpdateLayeredWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal hdcDst As Long, pptDst As Any, psize As Any, ByVal hdcSrc As Long, pptSrc As Any, ByVal crKey As Long, ByRef pblend As BLENDFUNCTION, ByVal dwFlags As Long) As LongPrivate Declare Function GdipCreateFromHDC Lib "gdiplus" (ByVal hdc As Long, graphics As Long) As LongPrivate Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As LongPrivate Declare Function GdipDrawImageRect Lib "gdiplus" (ByVal graphics As Long, ByVal image As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) As LongPrivate Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal filename As String, image As Long) As LongPrivate Declare Function GdipGetImageWidth Lib "gdiplus" (ByVal image As Long, Width As Long) As LongPrivate Declare Function GdipGetImageHeight Lib "gdiplus" (ByVal image As Long, Height As Long) As LongPrivate Declare Function GdipDisposeImage Lib "gdiplus" (ByVal image As Long) As LongPrivate Declare Function GdiplusStartup Lib "gdiplus" (gToken As Long, inputbuf As GdiplusStartupInput, Optional ByVal outputbuf As Long = 0) As LongPrivate Declare Sub GdiplusShutdown Lib "gdiplus" (ByVal gToken As Long) Private Type BLENDFUNCTION BlendOp As Byte BlendFlags As Byte SourceConstantAlpha As Byte AlphaFormat As ByteEnd Type Private Type Size cx As Long cy As LongEnd Type Private Type POINTAPI x As Long y As LongEnd Type Private Type BITMAPINFOHEADER biSize As Long biWidth As Long biHeight As Long biPlanes As Integer biBitCount As Integer biCompression As Long biSizeImage As Long biXPelsPerMeter As Long biYPelsPerMeter As Long biClrUsed As Long biClrImportant As LongEnd Type Private Type BITMAPINFO bmiHeader As BITMAPINFOHEADER bmiColors() As LongEnd Type Private Type GdiplusStartupInput GdiplusVersion As Long DebugEventCallback As Long SuppressBackgroundThread As Long SuppressExternalCodecs As LongEnd Type Private Const ULW_ALPHA As Long = &H2Private Const DIB_RGB_COLORS As Long = 0Private Const AC_SRC_ALPHA As Long = &H1Private Const AC_SRC_OVER As Long = &H0Private Const WS_EX_LAYERED As Long = &H80000Private Const GWL_EXSTYLE As Long = -20Private Const HWND_TOPMOST As Long = -1Private Const SWP_NOMOVE As Long = &H2Public Const HTCAPTION As Long = 2Public Const WM_NCLBUTTONDOWN As Long = &HA1 Public Function SplashForm(Frm As Form, sImgPath As String) As Boolean Dim GpInput As GdiplusStartupInput Dim BI As BITMAPINFO Dim hImage As Long Dim hGraphics As Long Dim SZ Ace Size Dim PT As POINTAPI Dim mDC As Long Dim hBitmap As Long Dim BF As BLENDFUNCTION Dim gToken As Long Dim OldhBitmap As Long GpInput.GdiplusVersion = 1 If GdiplusStartup(gToken, GpInput) = 0 Then If GdipLoadImageFromFile(StrConv(sImgPath, vbUnicode), hImage) = 0 Then Call GdipGetImageWidth(hImage, SZ.cx) Call GdipGetImageHeight(hImage, SZ.cy) mDC = CreateCompatibleDC(Frm.hdc) With BI.bmiHeader .biSize = Len(BI.bmiHeader) .biBitCount = 32 .biWidth = SZ.cx .biHeight = SZ.cy .biPlanes = 1 .biSizeImage = .biWidth * .biHeight * (.biBitCount / 8) End With hBitmap = CreateDIBSection(mDC, BI, DIB_RGB_COLORS, ByVal 0, 0, 0) OldhBitmap = SelectObject(mDC, hBitmap) Call GdipCreateFromHDC(mDC, hGraphics) Call GdipDrawImageRect(hGraphics, hImage, 0, 0, SZ.cx, SZ.cy) Call GdipDisposeImage(hImage) Call GdipDeleteGraphics(hGraphics) Call GdiplusShutdown(gToken) Else Call GdiplusShutdown(gToken) MsgBox "Error reading image" , vbCritical Exit Function End If Else MsgBox "Failed to start GDI +" , vbCritical Exit Function End If SetWindowLong Frm.hwnd, GWL_EXSTYLE, GetWindowLong(Frm.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED SetWindowPos Frm.hwnd, HWND_TOPMOST, 0, 0, SZ.cx, SZ.cy, SWP_NOMOVE With BF .AlphaFormat = AC_SRC_ALPHA .BlendOp = AC_SRC_OVER .SourceConstantAlpha = 255 End With SplashForm = UpdateLayeredWindow(Frm.hwnd, Frm.hdc, ByVal 0&, SZ, mDC, PT, 0, BF, ULW_ALPHA) DeleteObject SelectObject (MDC OldhBitmap) DeleteDC mDCEnd Function
Option Explicit Private Sub Form_Load() Call SplashForm(Me, "C:\Users\Windows\Desktop\FormTransp\aaa.png")End Sub Private Sub Form_DblClick() Unload MeEnd Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Call ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&End Sub
No entiendo, que significa "quiero poner las herramientas"?
Me parece que uso un traductor, y se refiere a poner controles sobre el formulario, y bueno la respuesta mas corta es no
hello, give an explanation of why not in English is complicated for me, you can put controls, but these are not rendered, there are some methods, which is to put another container window on same.if you are interested in deepening the topic see the following suite of classes cWidget.cls http://leandroascierto.com/blog/estado-del-tiempo/