15,917,059 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 14884389 (Top 6 by date)
Member 14884389
15-Aug-20 16:17pm
View
I have a programm that uses a webbrowser (which fills the entire window) to create an explorer like interface. https://tablacus.github.io/explorer_en.html
I'm trying to replace the old looking console grey background with an extendaero background like in windows 7 explorer https://i.computer-bild.de/imgs/5/9/9/1/7/8/5/Windows-7-und-8-Das-hilft-wenn-sich-Fenster-langsam-oeffnen-Manchmal-startet-1024x576-b8e06cd96cb52467.jpg
and my problem is that i'm unabled to make the mentioned part of the browser background invisable to make room for the extend aero part that lies underneath the browser.
Member 14884389
14-Aug-20 5:31am
View
it has nothing to do with vb this can also be done in c++ forms
Member 14884389
12-Aug-20 14:18pm
View
https://www.bilder-upload.eu/bild-e3d635-1597256412.png.html
https://www.bilder-upload.eu/bild-51bd12-1597256437.png.html
code:
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Runtime.InteropServices
Public Class Form1
Private mExtendedFrameMargins As MARGINS
Protected Overrides Sub _
OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
'use either one
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
End Sub
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
If IsGlassEnabled() Then
'You should paint the extended frame black for proper composition, but I'm painting it white as you need it
e.Graphics.FillRectangle(Brushes.Black, 0, 0, Me.ClientRectangle.Width, mExtendedFrameMargins.cyTopHeight)
End If
End Sub
Private Function IsGlassEnabled() As Boolean
If Environment.OSVersion.Version.Major < 6 Then
Return False
End If
Dim isGlassSupported As Boolean = False
DwmIsCompositionEnabled(isGlassSupported)
Return isGlassSupported
End Function
<dllimport("dwmapi.dll")>
Private Shared Function DwmIsCompositionEnabled(<marshalas(unmanagedtype.bool)> ByRef pfEnabled As Boolean) As Integer
End Function
<dllimport("dwmapi.dll")>
Private Shared Function DwmExtendFrameIntoClientArea(ByVal hwnd As IntPtr, ByRef pMarInset As MARGINS) As Integer
End Function
<structlayout(layoutkind.sequential)>
Private Structure MARGINS
Public cxLeftWidth As Integer
Public cxRightWidth As Integer
Public cyTopHeight As Integer
Public cyBottomHeight As Integer
End Structure
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WebBrowser1.DocumentText = ""
If IsGlassEnabled() Then
mExtendedFrameMargins = New MARGINS
mExtendedFrameMargins.cyTopHeight = Me.Height 'type height here, this is going to be a number (integer)
DwmExtendFrameIntoClientArea(Me.Handle, mExtendedFrameMargins)
End If
End Sub
Private Sub Form1_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
If IsGlassEnabled() Then
mExtendedFrameMargins = New MARGINS
mExtendedFrameMargins.cyTopHeight = Me.Height 'type height here, this is going to be a number (integer)
DwmExtendFrameIntoClientArea(Me.Handle, mExtendedFrameMargins)
End If
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
WebBrowser1.Document.BackColor = Color.FromArgb(1, 255, 0, 0)
If IsGlassEnabled() Then
mExtendedFrameMargins = New MARGINS
mExtendedFrameMargins.cyTopHeight = Me.Height 'type height here, this is going to be a number (integer)
DwmExtendFrameIntoClientArea(Me.Handle, mExtendedFrameMargins)
End If
End Sub
' Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
' WebBrowser1.Document.BackColor = Color.Black
' End Sub
End Class
What you can see inside the red box is a Webbrowser with document color red and the transparency key of th form is set to red so it will trigger the extendaero api in this webbrowser where no alpha value is given. I'm trying to achive the same result in a c++ non form application but i couldn't find anything like the Transparency key in c++. The goal is to make th webbrowser control invisible
Member 14884389
10-Aug-20 15:33pm
View
I'm trying to get parts of the webbrowser compleatly see-through so i can use the extend title feature to make it look like the title bar is part of the webbrowser
Member 14884389
10-Aug-20 10:28am
View
I think you don't quite get what I'm trying to do. That way only the html document gets transparent and not the browser itself (it's still white background even with alpha 0). Im searching for some type of C++ alternative to the Transparencykey from C++ Forms. The question isn't how to make the html document transparent it's how to make a browser transparent (which to my knowledge is impossible) or find a way around the webbrowser to show the window background which is an extended title bar like the code above shows. I already tested (in C++ Forms) that rgba(255, 0, 0, 1) html parts are showing the window background when the Transparencykey is rgba(255, 0, 0, 1).
Here is what i'm trying to do done in Forms https://stackoverflow.com/questions/20141220/how-can-i-set-a-transparent-background-colour-for-a-webbrowser-in-vb-net
Member 14884389
23-Jul-20 20:59pm
View
How should I use it to solve my problem? Is it possible to color a webbrowser with them and if yes how? Can you give me some syntax the website you linked isn't loading.
Show More