Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Removing Window Styles


In C++ you can use something like this to remove a window style:


Code:
DWORD Styles;
void RemStyle(DWORD Style)
{
Styles &= ~Style;
SetWindowLong(<hwnd>,GWL_STYLE,Styles);
}
//RemStyle(WS_CAPTION);
How would you do this in vb?


Code:
dim Styles as long
sub RemStyle(Style as long)
Styles = Styles And <something>Style
SetWindowLong <hwnd>, GWL_STYLE, Styles
end sub

I'm not sure what you would use instead of ~.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Window Styles
What window style could I use to allow for the cursor to be placed on the right hand side of a textbox, instead of the default left hand side?

Window Styles (No Border)
Wht I want to do is set the style of a window (of another application) like VB's "0 - None", or to remove the window border.

Getting A List Of Window Styles...
Is there a way to determine what styles a window has, other than running through a list and testing each one against GetWindowLong()? Like Spy++ gives you a list of the current styles that a window has, does it just test each one, or is there a better way?

How To Change Window Styles...
Under Windows 2000 or something similar (not XP) how would I go about changing the window styles in VB? such as for title bar, menus, etc..

not just for my program but on teh whole system

thanks

SetWindowRgn API With XP Window Styles
I have a form that I want to cut a square hole out of a standard VB form. I use standard region API calls and this works fine.

However, I find that whenever I use SetWindowRgn, I lose the "Windows XP" look of the form - ie. the form reverts to "Windows Classic" appearance, without the rounded title bar and blue frame.

Is this avoidable? Ideally, I'd like to keep the XP form look when using my app in XP. Has anyone help come across this and have a solution?

Thanks in advance to anyone who can help!

Cross Process Window Styles
I need to change the style flages of a window that is not in the same process as my program. SetWindowLong (with gwl_style) only work withing the calling process. How do I change the style flags on a window outside my program's process?

Window Styles WS_VSCROLL/WS_HSCROLL And The Frame Control
Hi,

When I use SetWindowLong with the above style bits I can make a Frame control show scrollbars but, unlike other container controls, these scrollbars never generate WM_VSCROLL or WM_HSCROLL messages - it is as if the non client area of these controls is always disabled?

Any thoughts on how to get them to work?

Thanks in advance,
Duncan

CoolBar+XP Styles+Toolbar &lt;&gt; XP Styles
I am having trouble getting the styles on the toolbar and coolbar to work together. When I add a manifest file the project the coolbar gets the new XP style and the toolbar is still flat and gray. Is there anyway around this?

Removing A Border From A Window
Hey I am using the mcisendstring api so that I can play an avi video in VB. I have got that working fine. Anyway there is a border around the video when it plays with the cross, minimise and maximise symbol. I want the video with no border. Does anyone know how i would do it.

Here is my code.


Code:
Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long

i = mciSendString("open c:myvideo.avi type avivideo alias video1", 0&, 0, 0)
i = mciSendString("play video1", 0&, 0, 0)

Removing Window From Taskbar
Ok here's the Problem

i have a list of windows enumerated for me by a function. This means i have the Hwnd of each window, allowing be to get caption etc.

What i need to do is Remove the desired window from the Taskbar so that it seems that its no longer their but without closing/hiding the window.

I believe this is possible, but cant seem to figure out how..

Any help Appreciated!

Removing Borders And Caption Bar From Another Window
I need to remove the Window border and caption bar from a window (basically like setting BorderStyle to None)

I have the windows hWnd, and I need help.

Actually, this question will probably end up in the API Help section.

Removing CTRL+N (New Window) Functionality From WebBrowser?
Can this be done? I've searched around a bit but really found nothing.. If I can't outright delete it, can I apply an override by making a new keyboard shortcut for something lame in place of Ctrl+N? (Which I also do not know how to do)

Thanks

Creating And Removing Desktopicons And Removing A Map From Taskbar
How to create a desktop icon and remove it again and how to delete a folder from the taskbar within programs??

XP Styles
Hi all!
I have some projects that use XP Style visualization if the operating system is Windows XP; I also prevent errors that occour (in some circumstances) when you close the program.
The question is simple:
Can I use XP Style when the program runs in the IDE?

XP Styles
Hi, im trying to get my app to use the xp styles (as you probably guessed). Ive looked at http://www.vbaccelerator.com/home/VB...VB/article.asp and i swear i follwed it to the letter but my app will not load, i just get an error sound from my speakers.

I copyed and pasted the manifest code and this is what ive got in my app:


Code:
Private Const ICC_USEREX_CLASSES = &H200

Public Function InitCommonControlsVB() As Boolean
On Error Resume Next
Dim iccex As tagInitCommonControlsEx
' Ensure CC available:
With iccex
.lngSize = LenB(iccex)
.lngICC = ICC_USEREX_CLASSES
End With
InitCommonControlsEx iccex
InitCommonControlsVB = (Err.Number = 0)
On Error GoTo 0
End Function

Public Sub Main()
InitCommonControlsVB

End Sub

Private Sub Command1_Click()
MsgBox "test Message"
End Sub

I complied it as test.exe and my manifest is called test.exe.manifest
Ive tryed:

Code:
Public Sub Main()
InitCommonControlsVB
Private Sub Command1_Click()
MsgBox "test Message"
End Sub
End Sub

and as expected that didnt work either.

i think im doing something thats so obvious that im gonna look stupid for posting this :/

Tab Styles
I am trying to use the tab style on a form, but I can not get the color to change from that horrid grey... the controls will only let me change the background color, not the app work space... anyone?????????

Styles
I want my documents to be formatted with Heading 1 and Body Styles. I have a macro to format with heading1 and another macro to format with body style.

After I put my heading in Word wants to use the normal style. I tryed to changed normal.dot to show that the style following heading 1 should be body but no matter what I do it seems Word changes it back to normal.

What is the correct way to change Heading 1 so that body style always follows it?

XP Styles
Helo
I m using windows XP.Can i use Win XP Style in my VB Application that will also work in win98 and win ME.
Bye.....

XP Styles Help [vb6]
I need to add XP Styles to my Project.

Can someone link me to a tutorial?

-Andrew

XP Styles In VB6
I've gotten VB6.EXE to load XP styles with this manifest file:
<?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="A.B.C"
type="win32" />
<description>Name</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
</assembly>

VB6.EXE loads fine and loads the style fine, and my app has the VB style, but when I compile my app and try the manifest with that, my app opens then immedietly closes.

XP Styles
I've searched high and low for how to do this, and I keep seeing http://www.vbforums.com/showthread.php?t=234280&highlight=winXP+Styles same solution to getting my app to show as XP style app. However, I cannot seem to get it to work, at all.

I've saved the manifest file as myappname.exe.manifest and included the required code in my main app form, as well as attempted it in my main startup sub.

These are some screenshots of references and components. When I try to add the comctl32.dll I get a "Can't add a reference to the specified file" error.

For some reason these linkswon't click to the pics, so you'll have to copy then to you browser...
http://comlinkonline.tripod.com/foxardevelopments/references.jpg
http://comlinkonline.tripod.com/foxardevelopments/addreference.jpg
http://comlinkonline.tripod.com/foxardevelopments/components.jpg

How Can You Add XP Styles To A Dll?
I have a dll that loads when microsoft outlook is loaded..

this dll also has a form with it, one that loads when a button is clicked in outlook. How can i get this form to have XP Style?

Win XP Styles
could someone show me a source code on how 2 use WinXP visual styles in VB apps?

App Styles
Are there any available toolkits for VB that give different style UI frameworks ?? Such as DevStudio, Outlook, Explorer etc....

I suppose I am really looking for the VB equivalent of the MFC CJLibrary at CodeGuru... Is there such a beast ???

Hope someone can help

Steve.

Manifest XP Styles
I have successfully installed the .manifest from posts on this site. This is the result that I get.

Things to notice:
The Frame around Marital Status is not like the other frames (option controls used inside frame) and the command buttons are not drawn correctly.

Here is the fix ---
From previous threads, I have read that placing a picture box on the screen would solve the option control to display correctly. I applied this theory to both frames within a frame (as in my case) and command buttons within a frame

I set the border style property of the picture box to 0 - None. Place the picture control inside the frame and then place the control inside the picture box.

Hope this helps for anyone else dealing with manifest files or XP Styles

Help Making Vb6 Use Xp Styles
i found a script that lets me use window xp buttons in visual basic 6 apps. u know the cool looking rounded buttons. do u know how i can have everything be xp style? like textboxes,progressbar,check boxes,radio boxes, and those stuff. i tried google but i could only fidn stuff for vb.net if u know any dlls or user control scripts then could u plz tell me?

Visual Styles
I have looked, and looked.And darn, still have not found a thing on it.
What I want to do is make a Visual Style editor/maker, but I have not found a thing on how a visual style is even made.Is it just a 'manifest' stored somewhere for the entire system?

Border Styles
Heres a question I need solved. What if one of your main forms is using a border style of fixed single(1) When running the application and you press the close icon at the top right, how do you get it to end the process as currently it seems to hide the application but not end the process

Much help would be appreciated.

XP Styles Flicker
I've been changing my app over to use XP styles following the suggestions in many of the posts here and elesewhere.
Everything is fine except for two things...

1.) The captions of some frames are cut short. I've messed with a few settings, like using the Button Face color, and changeing the font size, and type. But nothing seems to work.

2.) As I mouse around the forms, the label controls flicker.

Any ideas on this would be helpful. Thanks.

Converting Map Styles
I'm currently making a 2D rpg using DX7 Fullscreen DD. I have my current map system where each map is a screen big and when users hit the edge it moves them to a new map. I want to know how to go from this poor method to having larger Areas that are scrolling. When I say areas, I mean I dont want the whole world to be one map, I can split it up into a bunch of areas. I just want each area to be bigger than 1 screen size.

Alright, I've repeated myself enough.

So how would I save/load a map larger than the screen size? How do I tell it to blt only a certain section of the map?

PS: I'd also like to point out that this game is tile-based so using one fat picture won't do. 32x32 are the tile dimensions.

Thanks in advance,
- Vinx

Many Copys Of My Styles
Hi,

I have the following problem:

I have a macro in MS Excel that opens a Word-file and adds some subdocuments. I'm using this command:

<document>.Subdocuments.AddFromFile(<filename>)

It works pretty good, except I have a lot of copys for every Style after that. For exemple:

MyStyle
MyStyle1
MyStyle2
MyStyle3
...

When I open the Masterdocument myself and add the subdocuments manually a popup appears that askes me to rename the styles of the subdocument. When I answer "No" everything's fine. But I didn't find any attribute that could tell Word to not rename the styles.

Any ideas?

Thanks a lot
Unrockbar

Button Styles
Are there any alternative button styles available for VB??

Cell Styles In Vba?
Hi everybody,

I can get the style of a cell in vba, btu if one cell contains multiple styles (bold etc) and multiple colors, is there a way to get these per character?

thnx!
smeaggie

CmdButton Styles
Hey all,

This one's really stumped me big time.
Ok, cmdButtons right? They look 3D. But in some programs, (eg Internet Explorer) the toolbar is not 3D until you put your mouse over the buttons; then when you move your mouse out again, they go back to flat.
How do I do this????

Cheers all.

Chief

"Dammit Smithers, this is brain surgery not rocket science!! Now hand me that ice cream scoop..."

Border Styles
I use the following code (from PlanetSorceCode.com) to set the border style of a user control. The code works great, I was wondering if anyone knows the constants for other border styles.


Code:
''## Border Styles
Private Const GWL_EXSTYLE As Long = (-20)
Private Const GWL_STYLE As Long = (-16)
Private Const SWP_NOMOVE As Long = &H2
Private Const SWP_NOSIZE As Long = &H1
Private Const SWP_NOZORDER As Long = &H4
Private Const SWP_NOACTIVATE As Long = &H10
Private Const SWP_FRAMECHANGED As Long = &H20 ' The frame changed: send WM_NCCALCSIZE
Private Const SWP_NOOWNERZORDER As Long = &H200 ' Don't do owner Z ordering

Private Const WS_EX_CLIENTEDGE As Long = &H200
Private Const WS_EX_STATICEDGE As Long = &H20000


Public Property Let Appearance(ByVal New_Appearance As AppearanceConstants)
Dim lStyle As Long

menmAppearance = New_Appearance
lStyle = GetWindowLong(UserControl.hwnd, GWL_EXSTYLE) 'Retrieve current style

Select Case New_Appearance 'Toggle style flags
Case [Flat]: lStyle = lStyle And Not WS_EX_CLIENTEDGE And Not _
WS_EX_STATICEDGE
Case [3D]: lStyle = lStyle Or WS_EX_CLIENTEDGE And Not WS_EX_STATICEDGE
Case [Thin]: lStyle = lStyle And Not WS_EX_CLIENTEDGE Or WS_EX_STATICEDGE
End Select

SetWindowLong UserControl.hwnd, GWL_EXSTYLE, lStyle 'Apply changes
SetWindowPos UserControl.hwnd, 0, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOZORDER Or _
SWP_FRAMECHANGED Or SWP_NOSIZE Or SWP_NOMOVE
PropertyChanged "Appearance"
End Property

XP Styles And Frame
Hello

I made my program have xp styles on it with a manifest file.
Now my frames are shown differently ( as expected ), but no matter what i do I can't change the forecolor of the frame anymore.. It's always kinda blue

what can i do to make it white or something??

How To Add Xp Visual Styles To Vb6.0
How to add xp visual styles to vb6.0 forms & controls.

WinXP Styles!
A silly question probably but still asking..............

I have come across many posts in this forum which tell how to incorporate XP styles in a VB app. What I want to know is do those codes render the XP styles to a VB app when the app is run in WindowsXP only? If the app is run in some other OSs like Win2K or Win98 SE, won't the app render the XP styles using that code?

Problem With XP Styles
Ok I have an application in VB6 and i am trying to apply XP styles to the app. The styles apply fine, but when there is a button on a frame it draws a black box around the button. Also with checkboxes or radio buttons on frames they caption just shows up as a blacked out box. Is there any way to correct this or is the only solution to take them off of frames? Any help would be appreciated. thanks.

XP Styles Issue
I ran in to an interesting problem with VB6 (using SP6 on a WinXP Pro Box w/ SP2 installed.) today. When I add a ListBox control to a from the scroll buttons appear using the XP Style rather than the standard style for VB6.

So far this is the only Common Control I've noticed doing this. I installed VB6 and SP6 on a fresh machine. Created a new project and dropped a ListBox control on a form; no change.

In my searches I found KB884883 on Microsoft's site that described a problem similar to mine if the PC had versions 5 and 6 of the common controls. I tried installing the patch on my test machine and still no change. I haven't yet seen any information pertaining to this issue.

Also in my searches I noticed that there is a way to change the controls to display using the XP Style if you create a manifest file. Figuring I'd do this to make the controls on the form match I created a manifest file, etc. This is where I ran in to a second problem. The Date Picker control does not display using the XP Style. I'm having a hard time figuring out why it won't display properly.

Could anyone give me some insight in to either issue?

Thanks much in advance.

Windows XP Styles
Hello, I have created several programs and want to enable them to use Windows XP style form controls. I am currently using Manifest files for each program but am wondering if there is a way of implementing something into the code to do this instead. There must be someway of doing this as the majority of programs do not have Manifest files but still seem to use the Windows XP theme.

I would also like to know why when I use an icon file for my forms, the 16 colour icon is used on the title bar. Is there way of making it use the 32-bit icon format instead!

Please let me know. Thanks in advance!

Button Styles...
Ok....you can make funny shaped forms, what about... circle Command Buttons? I was going to create a form and have the buttons fit really well with the form, like on Windows Media Player.

Do I have to create my own button, or can I do it with some coding similar to a form?

Webbrowser + Styles
I am using the web browser control in my project and i need to use styles. The problem is that i need to be able to change the style sheet for the page. I can achieve what i need by saving everything to a temp file and then loading that file into the webbrowser. The problem with this is that each time i need to reload the page (i do this lots), is that it clicks each time.

I am using the webbrowser1.Document.body.innerhtml to set the body of the page, but i dont know how to load the styles. Can anyone help me??

Thanks.

XP Styles 2nd Episode
Thanks again for those who replied in "XP style". I'm starting this new thread is because the manifest file I receive works with all the controls except the toolbar.

I tried including components from SP2 to SP5. The tool bar conversion to XP style works fine with SP2 but not the newer versions. How can this be? And how do I solve it?

Regards,
Thundura

Resotre CR Styles
Hello guys,
I need some help with a nasty problem.

I got this code that clears up ^13 character styles.

Code:    
     objSelection.HomeKey 6 'wdStory
     objSelection.Find.ClearFormatting
     objSelection.Find.Replacement.ClearFormatting
     objSelection.Find.Replacement.Style = objDoc.Styles(&HFFFFFFBE) 'wdStyleDefaultParagraphFont
     With objSelection.Find
     .text = "[^13]" ' "[^13^9]"
     .Replacement.text = "^&"
     .Forward = True
     .Wrap = 1
     .Format = True
     .MatchCase = True
     .MatchWholeWord = False
     .MatchWildcards = True
     .MatchSoundsLike = False
     .MatchAllWordForms = False
     End With
     Call objSelection.Find.Execute( , , , , , , , , , , 2 )



However after the script finishes its work, I need to restore the styles of the ^13 characters.
Currently I'm trying to loop back the paragraph styles, looking for ^13 characters and setting styles,
but it seems a bit wrong to me

Code:
   For i = objDoc.Paragraphs.Count - 1 To 1 Step -1
     
      Set par = objDoc.Paragraphs(i)
      
      If (Asc(par.Range.Text) = 13) Then
       par.Range.Style = "NORMAL"
       par.Range.Font.Size = 11
      Else
       Exit For ' exit on the first text paragraph
     End If
        
   Next




Is there an easy way to do that, besides keeping an array of styles or anything ?

thanx





Edited by - peter_g on 9/1/2005 11:04:52 AM

View Text Using CSS-Styles
Hi,
is there a way to make RichEdit/Textedit EDIT AND show Text using original CSS-Styles with all its features?

I basicly need to make a text-editor where you can edit AND view Text using original CSS-styles, 1:1 as you would see it later in a Browser. The user is not allowed to mark Text to make it bold/italic etc.., he has to use a CSS-Styles to format his Text.

There is a great OCX-control (http://nbit.net.au/home.aspx) where you can edit a Webpage in WYSIWYG-style, but this OCX handles all Keyboard-input by itself and doesn't have any .selstart, .selenght etc. methods. Its useless for my 'Straight CSS-Style Texteditor".

Thanks in advance for anything pointing me into the right direction.

GDI CreateCompatibleDC - Hatched Styles?
OK this is driving me crazy:
I wrote this code to create a back buffer DC and fill it with a colour:


Code:
GetWindowRect hwnd, WinR

aRect.Right = 40
aRect.Bottom = WinR.Bottom - WinR.Top

hDC = GetWindowDC(hwnd)

mDC = CreateCompatibleDC(hDC)
hBitmap = CreateCompatibleBitmap(mDC, 40, WinR.Bottom - WinR.Top)
DeleteObject SelectObject(mDC, hBitmap)

hBrush = CreateSolidBrush(RGB(222, 222, 222))
FillRect mDC, aRect, hBrush
DeleteObject hBrush

Technically, this works, but when I Blt it to a control, it appears that the DC has some hatched style over the top, even though I used CreateSolidBrush

Can't seem to find a way around this, hoping someone knows.

Thanks.

EDIT: Sorry, posted the thread in the wrong place... Can someone move it?

Font Styles In A List Box
Hi

I have a list on my program. I want to the listbox to display a line of text but i want a few of the words in bold. I currently have

List1.AddItem ("Click Yes, No or Cancel")

I want the Yes, No and cancel in bold

Can this be done?

XP Styles In Windows 9x/2000
Hi!

Is there any good way to use/have windows xp styles for controls in windows 9x or 2000?
I'm using .manifest for xp but i don't know how to do the same in the above mentioned OS

Any idea or ActiveX known component???

Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved