2021/10/08
Windows 11에서 이전버전의 Context Menu 사용하기
Windows 11을 사용하면서 가장 불편한 점이 개편된 Context Menu였다.

새로운 Context Menu는 몇 개의 대표 메뉴로 구성되었고 이전의 Context Menu를 보려면 "Show more options" 메뉴를 선택해야만 하였다.
Context Menu 에 등록된 압축관련 메뉴와 폴더 생성 메뉴를 자주 사용하기에 개편된 Context Menu는 상당히 불편하였다.
Windows 11 22000 버전 이전에는 옵션메뉴를 통해 이전 Context Menu로 변경할 수 있었으나 22000 버전 이후로는 이마저도 막혀버렸다.
그러던 중 레이스트리를 편집하여 이전 버전의 Context Menu를 활성화 하는 방법을 찾았다.
레지스트리 편집기를 열어 HKEY_CURRENT_USER\Software\Classes\CLSID 에 {86ca1aa0-34aa-4e8b-a509-50c905bae2a2} 를 추가하고 추가한 {86ca1aa0-34aa-4e8b-a509-50c905bae2a2} 키에 서브키 InprocServer32 를 추가한 후 (Default) 값을 공란으로 설정한다.

레지스트리 편집을 마치고 재부팅을하면 이전 Windows 10 버전의 Context Menu를 볼 수 있다.

2021/07/07
[Windows 11] 파일 탐색기의 팝업메뉴(Context Menu)을 Windows 10 형태로 변경하기
※ 22000.71 버전 이후로 적용이 되지 않는다. ☹️
Windows 11의 큰 변화중의 하나는 파일 탐색기의 리본바와 팝업메뉴의 간소화이다.
메인 메뉴의 사용이 많지 않는 나는 간소화에 큰 영향이 없는데 팝업 메뉴의 경우 간소화로 많은 불편함을 가져왔다.
탐색기 작업에 많은 부분을 팝업 메뉴로 처리를 했는데 기존의 메뉴를 부르기에는 매우 불편하게 변경이 되었다. 나와 유사한 생각을 하는 사람이 많아서인지 이전 형태의 팝업 메뉴로 전환하는 방법을 찾는 사람이 많은 것 같다.
이전 형태로 되돌리는 방법은 간단하였다. 폴더 옵션에서 "Launch folder windows in a separate process" 옵션을 선택해 주기만 하면된다.
이전 버전에도 있는 옵션인데 어찌 이번 버전에서는 탐색기의 외형까지 영향을 주는지는 모르겠으나 이 옵션을 설정하면 이전 형태의 탐색기를 사용할 수 있다.
2013/07/16
윈도우의 Context Menu를 확장해 주는 FileMenu Tools
윈도우의 Context Menu에 추가되어 다양한 기능을 지원하는 프로그램 이다.
특정 확장자를 특정 프로그램에 연결을 하거나 복사/이동 파일 이름 복사와 속성 변경 파일 영구삭제(복구방지) 기능 등을 기본적으로 지원한다.
필요에 따라 사용자가 메뉴를 추가하는 기능도 지원한다.
FileMenu Tool
Original Post : http://neodreamer-dev.tistory.com/717
2010/04/06
[Android Dev.] Context Menu 구성하기
메뉴 위쪽의 헤더 부분은 생략할 수 있고 필요에 따라 Custom View 로 대체할 수 있다. Context Menu 를 간단하게 분리해 보면 헤더의 유무와 헤더의 종류에 따라 분리할 수 있다. 아래는 각각의 경우에 따른 구현 내용이다.
공통으로 사용되는 Botton 의 Context Menu 리소스
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/MnuHi"
android:title="Hi!"
android:checkable="true"
android:checked="false"
/>
<item
android:id="@+id/MnuBye"
android:title="Bye!"
android:checkable="true"
android:checked="false"
/>
</menu>
메뉴 Header가 없는 Context Menu
메뉴 리소스로 부터 메뉴를 읽어들이기만 하면 위와 같은 심플한 Context Menu 가 출력이 된다.
public void onCreateContextMenu( ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuinfo )
{
if ( v == btnHello )
{
// menu_button.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_button, menu );
}
}
시스템에서 지원하는 Header를 갖은 Context Menu
public void onCreateContextMenu( ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuinfo )
{
if ( v == btnHello )
{
// menu_button.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_button, menu );
menu.setHeaderIcon( R.drawable.icon );
menu.setHeaderTitle( "Context for Button" );
}
}
Custom View 를 Header로 갖는 Context Menu
헤더에 사용된 View Layout 리소스 xml 파일 내용 (context_view_for_button.xml)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/IVContextL"
android:src="@drawable/icon"
android:layout_gravity="top|left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/TVContext"
android:layout_gravity="center_vertical|center_horizontal"
android:text="It's Custom Header on Context"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/IVContextR"
android:src="@drawable/icon"
android:layout_gravity="top|right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
메뉴 헤더에 View 를 올리는 코드
public void onCreateContextMenu( ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuinfo )
{
if ( v == btnHello )
{
// menu_button.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_button, menu );
menu.setHeaderIcon( R.drawable.icon ); // 무시됨
menu.setHeaderTitle( "Context for Button" ); // 무시됨
LayoutInflater layout = getLayoutInflater();
View v2 = layout.inflate( R.layout.context_view_for_button, null );
menu.setHeaderView( v2 );
}
}
<
Original Post : http://neodreamer-dev.tistory.com/402
2010/04/05
[Study Note] Context Menu 사용하기~~
Context Menu 를 사용하기 위해서는 View 를 registerForContextMenu 함수를 이용하여 Context Menu 를 호출 할 수 있도록 등록하여 주어야 한다.
registerForContextMenu( View v );
View 를 registerForContextMenu 를 이용하여 등록하면 해당 View 에서 사용자가 Long-Touch 를 하게되면 onCreateContextMenu 함수가 호출이 된다. 이때 넘겨 받은 View 개체에 따라서 적절한 Menu를 만들어 주면 만들어진 Menu가 보여지게 된다. Context Menu 는 서브 메뉴와 Checkable Menu 를 지원한다.
public void onCreateContextMenu( ContextMenu menu,
View v, ContextMenu.ContextMenuInfo menuInfo )
매개변수
ContextMenu menu : 보여지게 될 menu 개체
View v : Context Menu 를 소유한 View 개체
ContextMenu.ContextMenuInfo menuInfo : menu에 대한추가 적인 정보로 내용은 view 에따라 달라짐.
보여지는 Context Menu 를 선택하게 되면 onContextItemSelected 함수가 호출이 되고 이때 선택된 메뉴가 넘어 매개변수(MenuItem)로 오는데 받은 메뉴에 대한 적절한 처리를 해 주면 된다.
public boolean onContextItemSelected( MenuItem item )
매개변수
MenuItem item : 선택된 Context Menu
반환 값
선택 된 Menu item에 대한 처리 여부
리소스 파일 보기
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/MnuCopy"
android:title="Copy"
/>
<item
android:id="@+id/MnuCut"
android:title="Cut"
/>
<item
android:id="@+id/MnuPaste"
android:title="Paste"
/>
<item
android:title="Macro">
<menu>
<item
android:id="@+id/MnuMacro1"
android:title="Macro 1"
/>
<item
android:id="@+id/MnuMacro2"
android:title="Macro 2"
/>
<item
android:id="@+id/MnuMacro3"
android:title="Macro 3"
/>
</menu>
</item>
</menu>
menu_image.xml
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/MnuZoomFit"
android:title="Zoom Fit"
android:icon="@drawable/icon"
/>
<item
android:id="@+id/MnuZoomIn"
android:title="Zoom In"
android:icon="@drawable/icon"
/>
<item
android:id="@+id/MnuZoomOut"
android:title="Zoom Out"
android:icon="@drawable/icon"
/>
<item
android:title="Magnify"
>
<menu>
<item
android:id="@+id/MnuHalf"
android:title="x 0.5"
android:icon="@drawable/icon"
/>
<item
android:id="@+id/MnuFull"
android:title="x 1.0"
android:icon="@drawable/icon"
/>
<item
android:id="@+id/MnuDouble"
android:title="x 2.0"
android:icon="@drawable/icon"
/>
</menu>
</item>
</menu>
menu_button.xml
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/MnuHi"
android:title="Hi!"
android:checkable="true"
android:checked="false"
/>
<item
android:id="@+id/MnuBye"
android:title="Bye!"
android:checkable="true"
android:checked="false"
/>
</menu>
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/TVHello"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<ImageView
android:id="@+id/IVIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon"
android:layout_gravity="center"
/>
<Button
android:id="@+id/BtnHi"
android:text="Hi!"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
소스 파일 보기
package com.neodreamer.MyMenu;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class MyMenu extends Activity
{
TextView tvHello;
ImageView ivIcon;
Button btnHello;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tvHello = (TextView)findViewById( R.id.TVHello );
ivIcon = (ImageView)findViewById( R.id.IVIcon );
btnHello = (Button)findViewById( R.id.BtnHi );
registerForContextMenu( tvHello );
registerForContextMenu( ivIcon );
registerForContextMenu( btnHello );
}
public void onCreateContextMenu( ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuinfo )
{
if ( v == tvHello )
{
// menu_edit.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_edit, menu );
menu.setHeaderIcon( R.drawable.icon );
menu.setHeaderTitle( "Context for TextView" );
return;
}
if ( v == ivIcon )
{
// menu_image.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_image, menu );
menu.setHeaderIcon( R.drawable.icon );
menu.setHeaderTitle( "Context for ImageView" );
return;
}
if ( v == btnHello )
{
// menu_button.xml 에서 메뉴 불러오기
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.menu_button, menu );
menu.setHeaderIcon( R.drawable.icon );
menu.setHeaderTitle( "Context for Button" );
// Button 의 Caption 에 따라 메뉴 바꾸기
if ( btnHello.getText().toString().compareTo( "Hi!" ) == 0 )
{
menu.findItem( R.id.MnuHi ).setChecked( true );
}
else
{
menu.findItem( R.id.MnuBye ).setChecked( true );
}
return;
}
}
public boolean onContextItemSelected( MenuItem item )
{
switch ( item.getItemId() )
{
case R.id.MnuHi:
btnHello.setText( "Hi!" );
return true;
case R.id.MnuBye:
btnHello.setText( "Bye!" );
return true;
}
return false;
}
}
TextView 의 Context Menu | Context Menu의 Sub Menu |
ImageView 의 Context Menu | Context Menu의 SubMenu |
Button의 Context Menu 1 | Button의 Context Menu 2 |
<
Original Post : http://neodreamer-dev.tistory.com/401